Platforms to show: All Mac Windows Linux Cross-Platform
/Picture/Picture blending/blend with mask
Required plugins for this example: MBS Picture Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Picture/Picture blending/blend with mask
This example is the version from Wed, 14th May 2019.
Project "blend with mask.xojo_binary_project"
Class main Inherits Window
Control scr Inherits Canvas
ControlInstance scr Inherits Canvas
EventHandler Sub Paint(g As Graphics, areas() As REALbasic.Rect)
if img_res <> nil then
g.drawpicture img_res,0,0
end if
End EventHandler
End Control
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action()
quit
End EventHandler
End Control
Control sld Inherits Slider
ControlInstance sld Inherits Slider
EventHandler Sub ValueChanged()
img_proc sld.value
End EventHandler
End Control
EventHandler Sub Open()
img_a = new Picture(200,200,32)
img_a.graphics.drawpicture b1,0,0
img_b = new Picture(200,200,32)
img_b.graphics.drawpicture b2,0,0
img_res = new Picture(200,200,32)
img_proc sld.value
img_show
End EventHandler
Sub img_proc(bal as integer)
dim m as Picture
dim t,i as integer
m = new Picture(img_a.Width,img_a.Height,32)
m.Graphics.ForeColor=Rgb(bal,bal,bal)
m.Graphics.FillOval 0,0,m.Width,m.Height
m.Graphics.ForeColor=Rgb(0,0,0)
m.Graphics.FillOval 40,40,m.Width-80,m.Height-80
t=ticks
for i=1 to 100
img_res= BlendPicturesWithMaskMBS(img_a,img_b,m)
next
Title=str(ticks-t)
img_show
End Sub
Sub img_show()
scr.Invalidate
End Sub
Property Protected img_a As picture
Property Protected img_b As picture
Property Protected img_res As picture
End Class
MenuBar Menu
MenuItem UntitledMenu3 = ""
MenuItem UntitledMenu2 = "Ablage"
MenuItem FileQuit = "Beenden"
MenuItem UntitledMenu7 = ""
MenuItem UntitledMenu0 = "Bearbeiten"
MenuItem EditUndo = "Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Ausschneiden"
MenuItem EditCopy = "Kopieren"
MenuItem EditPaste = "Einfügen"
MenuItem EditClear = "Löschen"
MenuItem UntitledMenu6 = ""
MenuItem UntitledMenu5 = ""
MenuItem UntitledMenu4 = ""
End MenuBar
Class App Inherits Application
End Class
ExternalFile B1
End ExternalFile
ExternalFile B2
End ExternalFile
End Project
See also:
- /Picture/Picture Blending test
- /Picture/Picture blending/blend with plugin
- /Picture/Picture blending/blend without plugin
- /Picture/Picture Hash/Picture Hash
- /Picture/Picture manipulation
- /Picture/Picture MinMax/mmx_demo
- /Picture/Picture MinMax/mmx_demo with plugin
- /Picture/Picture Scale/Scale Compare
- /Picture/Picture Scale/Scale Test
- /Picture/Picture to Binary Data Test
The items on this page are in the following plugins: MBS Picture Plugin.