Required plugins for this example: MBS AVFoundation Plugin, MBS MacCocoa Plugin, MBS MacBase Plugin, MBS Main Plugin, MBS MacCG Plugin, MBS MacCF Plugin, MBS MacControls Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacFrameworks/IKPictureTaker not modal
Class Window1 Inherits Window
EventHandler Sub Open()
dim n as integer
p=new myIKPictureTakerMBS
if not p.Available then
MsgBox "This application requires Mac OS X 10.5 and a Macho Target"
Return
end if
p.AllowsFileChoosing=true
p.AllowsEditing=true
p.AllowsVideoCapture=true
p.ShowEffects=true
p.ShowRecentPicture=true
p.UpdateRecentPicture=true
p.InformationalText="Please take a picture"
p.ShowAddressBookPicture=True
'p.ShowEmptyPicture=True
if not p.beginPictureTaker then
MsgBox "Can't show picture taker!?"
end if
End EventHandler
Property Protected p As MyIKPictureTakerMBS
End Class
MenuBar MenuBar1
MenuItem UntitledMenu1 = ""
MenuItem FileMenu = "&File"
MenuItem FileQuit = "Quit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem UntitledMenu0 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "Clear"
End MenuBar
Class App Inherits Application
End Class
Class MyIKPictureTakerMBS Inherits IKPictureTakerMBS
EventHandler Sub Finished(returnCode as integer)
dim n as NSImageMBS
dim f as FolderItem
dim b as BinaryStream
window1.Title=str(returnCode)
if returnCode=1 then // ok
n=me.outputImage
window1.Backdrop=n.CopyPicture
window1.Refresh // refresh issue :-(
else
end if
End EventHandler
End Class