Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

/MacCG/NSImage and CGImage Test
Function:
Required plugins for this example: MBS MacBase Plugin, MBS MacCG Plugin, MBS Main Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacCG/NSImage and CGImage Test
This example is the version from Sun, 17th Mar 2012.
Project "NSImage and CGImage Test.rbp"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
Control Canvas1 Inherits Canvas
ControlInstance Canvas1 Inherits Canvas
End Control
Control Canvas2 Inherits Canvas
ControlInstance Canvas2 Inherits Canvas
End Control
Control Canvas3 Inherits Canvas
ControlInstance Canvas3 Inherits Canvas
End Control
Control Canvas4 Inherits Canvas
ControlInstance Canvas4 Inherits Canvas
End Control
Control Canvas5 Inherits Canvas
ControlInstance Canvas5 Inherits Canvas
End Control
Control Canvas6 Inherits Canvas
ControlInstance Canvas6 Inherits Canvas
End Control
Control StaticText1 Inherits Label
ControlInstance StaticText1 Inherits Label
End Control
Control StaticText2 Inherits Label
ControlInstance StaticText2 Inherits Label
End Control
Control StaticText3 Inherits Label
ControlInstance StaticText3 Inherits Label
End Control
Control Canvas7 Inherits Canvas
ControlInstance Canvas7 Inherits Canvas
End Control
Control Canvas8 Inherits Canvas
ControlInstance Canvas8 Inherits Canvas
End Control
Control Canvas9 Inherits Canvas
ControlInstance Canvas9 Inherits Canvas
End Control
EventHandler Sub Open() Title = RBVersionString if TargetCarbon then Title = Title + " Carbon" else Title = Title + " Cocoa" end if dim p as Picture = LogoMBS(200, true) canvas1.Backdrop = p dim n as new NSImageMBS(p) canvas2.Backdrop = n.CopyPictureWithMask dim c as CGImageMBS = CGCreateImageMBS(p) canvas3.Backdrop = c.Picture p = LogoMBS(200) dim g as Graphics = p.Mask.Graphics g.ForeColor = &cFFFFFF g.FillRect 0,0,200,200 g.ForeColor = &c000000 g.FillOval 0,0,200,200 canvas4.Backdrop = p n = new NSImageMBS(p) canvas5.Backdrop = n.CopyPictureWithMask c = CGCreateImageMBS(p) canvas6.Backdrop = c.Picture p = LogoMBS(200) dim m as new Picture(200,200,32) g = m.Graphics g.ForeColor = &cFFFFFF g.FillRect 0,0,200,200 g.ForeColor = &c000000 g.FillOval 0,0,200,200 canvas7.Backdrop = p n = new NSImageMBS(p,m) canvas8.Backdrop = n.CopyPictureWithMask c = CGCreateImageMBS(p,m) canvas9.Backdrop = c.Picture End EventHandler
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&Ablage"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Bearbeiten"
MenuItem EditUndo = "&Rückgängig"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "&Ausschneiden"
MenuItem EditCopy = "&Kopieren"
MenuItem EditPaste = "&Einfügen"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "&Alles auswählen"
End MenuBar
End Project

Feedback, Comments & Corrections

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




Links
MBS Xojo PDF Plugins