Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

MBS Xojo Plugin Tutorial Videos

Picture Source

Class App
Inherits Application
// Constants
Const kFileQuitShortcut = Ctrl+Q
Const kFileQuit = E&xit
Const kEditClear = &Delete
End Class

Class Window1
Inherits Window
// Controls
ControlInstance
Sub Action() Handles Event
canvas1.Backdrop=P4080146
End Sub
End ControlInstance
ControlInstance
End ControlInstance
ControlInstance
Sub Action() Handles Event
canvas1.Backdrop=canvas1.Backdrop.HMirrorMBS
End Sub
End ControlInstance
ControlInstance
Sub Action() Handles Event
canvas1.Backdrop=canvas1.Backdrop.VMirrorMBS
End Sub
End ControlInstance
ControlInstance
Sub Action() Handles Event
canvas1.Backdrop=canvas1.Backdrop.RotateMBS(Slider1.Value, &c000000)
End Sub
End ControlInstance
ControlInstance
Sub ValueChanged() Handles Event

End Sub
End ControlInstance
ControlInstance
End ControlInstance
ControlInstance
Sub Action() Handles Event
canvas1.Backdrop=canvas1.Backdrop.ChangeBrightnessLinearMBS(10)
End Sub
End ControlInstance
ControlInstance
Sub Action() Handles Event
canvas1.Backdrop=canvas1.Backdrop.ChangeBrightnessLinearMBS(-10)
End Sub
End ControlInstance
ControlInstance
Sub Action() Handles Event
canvas1.Backdrop=canvas1.Backdrop.ChangeContrastMBS(-0.1)
End Sub
End ControlInstance
ControlInstance
Sub Action() Handles Event
canvas1.Backdrop=canvas1.Backdrop.ChangeContrastMBS(0.1)
End Sub
End ControlInstance
ControlInstance
Sub Action() Handles Event
canvas1.Backdrop=canvas1.Backdrop.AutoLevelMBS
End Sub
End ControlInstance
ControlInstance
Sub Action() Handles Event
canvas1.Backdrop=canvas1.Backdrop.ScaleMBS(canvas1.Backdrop.Width/2, Canvas1.Backdrop.Height/2, true)
End Sub
End ControlInstance
ControlInstance
Sub Action() Handles Event
canvas1.Backdrop=canvas1.Backdrop.ScaleMBS(canvas1.Backdrop.Width*2, Canvas1.Backdrop.Height*2, true)
End Sub
End ControlInstance
ControlInstance
Sub Action() Handles Event
dim red, green, blue as MemoryBlock
dim count as integer
dim offset,i as integer
dim maxred, maxgreen, maxblue as integer
dim r,g,b as integer
dim p as Picture
dim gg as Graphics

red=NewMemoryBlock(1024)
blue=NewMemoryBlock(1024)
green=NewMemoryBlock(1024)

canvas1.Backdrop.CountColorsMBS(red, green, blue, count)

offset=0
for i=0 to 255
r=red.Long(offset)
g=green.Long(offset)
b=blue.Long(offset)

if r>maxred then maxred=r
if g>maxgreen then maxgreen=g
if b>maxblue then maxblue=b

offset=offset+4
next

p=NewPicture(300,256,32)
gg=p.Graphics

offset=0
for i=0 to 255
r=red.Long(offset)
g=green.Long(offset)
b=blue.Long(offset)

gg.ForeColor=&cFF0000
gg.DrawLine 0,i,100*r/maxred,i

gg.ForeColor=&c00FF00
gg.DrawLine 100,i,100+100*g/maxgreen,i

gg.ForeColor=&c0000FF
gg.DrawLine 200,i,200+100*b/maxblue,i

offset=offset+4
next

Canvas1.Backdrop=p

End Sub
End ControlInstance

// Event implementations
Sub Open()
me.Maximize
canvas1.Backdrop=P4080146
End Sub
End Class


All movies




Links
MBS Xojo PDF Plugins