Xojo Conferences

Platforms to show: All Mac Windows Linux Cross-Platform

/MacCG/CGImage with different color spaces
Required plugins for this example: MBS MacCG Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacCG/CGImage with different color spaces
This example is the version from Sun, 17th Mar 2012.
Project "CGImage with different color spaces.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 StaticText4 Inherits Label
ControlInstance StaticText4 Inherits Label
End Control
Control StaticText5 Inherits Label
ControlInstance StaticText5 Inherits Label
End Control
Control StaticText6 Inherits Label
ControlInstance StaticText6 Inherits Label
End Control
Control Canvas7 Inherits Canvas
ControlInstance Canvas7 Inherits Canvas
End Control
Control StaticText7 Inherits Label
ControlInstance StaticText7 Inherits Label
End Control
EventHandler Sub Open() dim display as new CGDisplayMBS dim r as CGRectMBS = CGMakeRectMBS(0,0,200,200) dim image as CGImageMBS = Display.CreateImageForRect(r) dim c as CGColorSpaceMBS = image.ColorSpace canvas1.Backdrop = image.Picture canvas2.Backdrop = Image.Picture(CGColorSpaceMBS.CreateDeviceRGB) canvas3.Backdrop = Image.Picture(CGColorSpaceMBS.CreateWithName(CGColorSpaceMBS.kCGColorSpaceGenericRGBLinear)) canvas4.Backdrop = Image.Picture(CGColorSpaceMBS.CreateWithName(CGColorSpaceMBS.kCGColorSpaceSRGB)) canvas5.Backdrop = Image.Picture(CGColorSpaceMBS.CreateWithName(CGColorSpaceMBS.kCGColorSpaceAdobeRGB1998)) canvas6.Backdrop = Image.Picture(CGColorSpaceMBS.CreateWithName(CGColorSpaceMBS.kCGColorSpaceGenericRGB)) canvas7.Backdrop = Image.Picture(c) StaticText1.text = "default" StaticText2.text = "DeviceRGB" StaticText3.text = "GenericRGBLinear" StaticText4.text = "SRGB" StaticText5.text = "AdobeRGB1998" StaticText6.text = "GenericRGB" StaticText7.text = "Image colorspace" 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.

The biggest plugin in space...

MBS Xojo tutorial videos