Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

/Picture/Picture blending/blend with mask
Function:
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 Thu, 16th Nov 2016.
Project "blend with mask.rbp"
Class main Inherits Window
Control scr Inherits Canvas
ControlInstance scr Inherits Canvas
EventHandler Sub Paint(g As Graphics, areas() As REALbasic.Rect) img_show 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.graphics.drawpicture img_res,0,0 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 UntitledMenu0 = "Bearbeiten"
MenuItem EditUndo = "Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Ausschneiden"
MenuItem EditCopy = "Kopieren"
MenuItem EditPaste = "Einfügen"
MenuItem EditClear = "Löschen"
End MenuBar
Class App Inherits Application
End Class
ExternalFile B1
End ExternalFile
ExternalFile B2
End ExternalFile
End Project

See also:

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS Picture Plugin.




Links
MBS Xojo PDF Plugins