You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Util/Resplugin Examples/Invert Video
Class Window1 Inherits Window
Control CheckBox1 Inherits CheckBox
ControlInstance CheckBox1 Inherits CheckBox
EventHandler Sub Action()
update me.Value
End EventHandler
End Control
Control StaticText1 Inherits Label
ControlInstance StaticText1 Inherits Label
End Control
EventHandler Sub Open()
if not ResolutionLibraryPresentMBS then
msgBox "The library RezLib was not found. Please place this library into the Realbasic or after compiling into your application folder."
end if
'Get the display on which to operate
dis = GetDisplayMBS(0)
gamma=dis.NativeGamma
End EventHandler
Sub update(invert as boolean)
dim g as MemoryBlock
dim i as integer
dim n,m as integer
if invert then
g=NewMemoryBlock(3072)
m=1024
n=0
for i=0 to 255
g.SingleValue(n)=1.0-i/255.0
n=n+4
m=m-4
next
m=2048
for i=0 to 255
g.SingleValue(n)=1.0-i/255.0
n=n+4
m=m-4
next
m=3072
for i=0 to 255
g.SingleValue(n)=1.0-i/255.0
n=n+4
m=m-4
next
dis.NativeGamma=g
else
dis.NativeGamma=gamma
end if
End Sub
Property dis As DisplayMBS
Property Protected gamma As memoryBlock
End Class
MenuBar Menu
MenuItem UntitledMenu3 = ""
MenuItem UntitledMenu2 = "File"
MenuItem FileQuit = "Quit"
MenuItem UntitledMenu0 = "Edit"
MenuItem EditUndo = "Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Cut"
MenuItem EditCopy = "Copy"
MenuItem EditPaste = "Paste"
MenuItem EditClear = "Clear"
End MenuBar
Class App Inherits Application
End Class