Background Correction
I'm having problems with this. Trying to do background correction with dark objects.. This is the recorded script, but I just get a white image.
Public Sub button1_Click_1(sender As Object, e As System.EventArgs)
With Process.BackgroundCommands.Correct(Nothing)
.BlackLevel = 0R
.Run(ThisApplication.ActiveDocument, ThisApplication.ActiveDocument, Nothing)
End With
End Sub
0
Answers
The background correction includes 2 commands (Extract Background and Correct). You macro shows just one command. Please, try to record the macro and post it here.
What is your Premier's version?
Thanks,
Nikita.
Your command looks edited manually the arguments in the Run function is not native. Does it work in the recorded version of the macro?
Also, there was a fix in 9.3.1 related to this command. Please try 9.3.1 (if you don't use it already).
Yuri
I'm still running 9.2 on this computer - perhaps I need to got to 9.3 as you suggest.
Public Sub button3_Click(sender As Object, e As System.EventArgs) Handles button3.Click With Process.BackgroundCommands.Correct(Nothing) .BlackLevel = 0R .Run(ThisApplication.ActiveDocument, ThisApplication.ActiveDocument, Nothing) End With End Sub
I recorded and tested the background correction macro in Premier. The macro looks like this (it works properly in 9.3.1):
The easiest way to do what you need is just to call the recorded macro from your event handler (instead of copy/pasting the code), even if the recorded macro is in different VB module of your project:
Yuri
have to upgrade to 9.3 - thanks for your help anyway.
There is an issue in the background commands recording/playback and we are looking on it.
The current solution is simplified macro then background image generated internally:
Public Function CorrectBrightBG() As SimpleScript CorrectBrightBG = New SimpleScript Dim doc1 With Application.DocumentCommands.Active(CorrectBrightBG) .Run(doc1) End With With Process.BackgroundCommands.Correct(CorrectBrightBG) .BackgroundType = Background.BackgroundTypes.Bright .FeatureSize = 50 .BlackLevel = 0R .Run(doc1, Nothing, doc1) End With End Function
Thanks,
Nikita.
Thanks,
Nikita.