Platforms to show: All Mac Windows Linux Cross-Platform

/MacCG/CGImageSource/CGImageSource Properties


Required plugins for this example: MBS MacCG Plugin, MBS MacCF Plugin

You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacCG/CGImageSource/CGImageSource Properties

This example is the version from Wed, 1st Oct 2013.

Project "CGImageSource Properties.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
EventHandler Sub Open() dim f as FolderItem = GetOpenFolderItem(FileTypes1.all) if f<>Nil then dim d as new CGImageSourceMBS(f) if d.Handle<>0 then dim i as new ImageWindow i.process d i.Title = f.DisplayName i.show end if end if End EventHandler
End Class
Class ImageWindow Inherits Window
Control List Inherits Listbox
ControlInstance List Inherits Listbox
EventHandler Sub ExpandRow(row As Integer) dim dic as Dictionary = me.RowTag(row) if dic<>Nil then for each key as Variant in dic.keys dim value as Variant = dic.Value(key) if value is nil then List.AddRow key.StringValue, "" elseif value isa Dictionary then // show sub dictionaries add value, key.StringValue elseif value.Type = value.TypeArray + value.TypeObject then // convert array of variant to string dim items() as Variant = value dim texts() as String for each v as Variant in items texts.Append v.StringValue next List.AddRow key.StringValue, Join(texts, ", ") else // show numbers and strings directly List.AddRow key.StringValue, value.StringValue end if next end if End EventHandler
End Control
Sub Add(dic as Dictionary, label as string) List.AddFolder label List.RowTag(List.LastIndex) = dic End Sub
Sub process(source as CGImageSourceMBS) List.AddRow "Type", source.Type dim dic as Dictionary = source.Properties Add dic, "global" dim u as integer = source.Count-1 for i as integer = 0 to u dic = source.PropertiesAtIndex(i) Add dic, "Image "+str(i+1) next End Sub
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&File"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "Select &All"
End MenuBar
FileTypes1
Filetype image/jpeg
Filetype image/png
Filetype image/gif
Filetype image/jp2
Filetype image/jpeg2000
Filetype image/tiff
Filetype image/x-bmp
Filetype image/x-quicktime
End FileTypes1
End Project

See also:

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


The biggest plugin in space...