Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

/MacFrameworks/IKImageEditPanel
Function:
Required plugins for this example: MBS AVFoundation Plugin, MBS MacBase Plugin, MBS MacCG Plugin, MBS MacCocoa Plugin, MBS MacControls Plugin, MBS Main Plugin, MBS Picture Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacFrameworks/IKImageEditPanel
This example is the version from Fri, 17th Nov 2016.
Project "IKImageEditPanel.rbp"
FileTypes
Filetype text
End FileTypes
Class Window1 Inherits Window
EventHandler Sub Close() panel.close End EventHandler
EventHandler Sub Open() dim p,mask as picture dim w,h as integer p=screenshotMBS w=p.width/2 h=p.height/2 pic = New Picture(w,h,32) pic.graphics.drawpicture p,0,0,w,h,0,0,p.width,p.height // try with mask pic.mask.graphics.foreColor=&cFFFFFF pic.mask.graphics.fillrect 0,0,pic.width,pic.height pic.mask.graphics.foreColor=&c000000 pic.mask.graphics.filloval 0,0,pic.width,pic.height // resize window to match picture width=w height=h // show panel panel=new imageeditPanel panel.left=w+me.left panel.top=screen(0).height-me.top-panel.height panel.show End EventHandler
EventHandler Sub Paint(g As Graphics, areas() As REALbasic.Rect) g.drawpicture pic,0,0 End EventHandler
Property Protected panel As imageeditPanel
Property pic As picture
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 ImageEditPanel Inherits IKImageEditPanelMBS
EventHandler Sub Changed(pic as picture, CGImageHandle as integer, metaData as dictionary) window1.pic=pic window1.refresh End EventHandler
EventHandler Function Image() As picture return window1.pic End EventHandler
End Class
End Project

Feedback, Comments & Corrections

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




Links
MBS Xojo Plugins