Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

/Picture/Icon/DropFile to see icon parts
Function:
Required plugins for this example: MBS Picture Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Picture/Icon/DropFile to see icon parts
This example is the version from Sun, 4th Aug 2012.
Project "DropFile to see icon parts.rbp"
FileTypes
Filetype special/any
End FileTypes
Class Window1 Inherits Window
Control Thumbnail32BitData Inherits Canvas
ControlInstance Thumbnail32BitData Inherits Canvas
End Control
Control Thumbnail8BitMask Inherits Canvas
ControlInstance Thumbnail8BitMask Inherits Canvas
End Control
Control Huge1BitMask Inherits Canvas
ControlInstance Huge1BitMask Inherits Canvas
End Control
Control Huge4BitData Inherits Canvas
ControlInstance Huge4BitData Inherits Canvas
End Control
Control Huge8BitData Inherits Canvas
ControlInstance Huge8BitData Inherits Canvas
End Control
Control Huge32BitData Inherits Canvas
ControlInstance Huge32BitData Inherits Canvas
End Control
Control Huge8BitMask Inherits Canvas
ControlInstance Huge8BitMask Inherits Canvas
End Control
Control Large1BitMask Inherits Canvas
ControlInstance Large1BitMask Inherits Canvas
End Control
Control Large4BitData Inherits Canvas
ControlInstance Large4BitData Inherits Canvas
End Control
Control Large8BitData Inherits Canvas
ControlInstance Large8BitData Inherits Canvas
End Control
Control Large32BitData Inherits Canvas
ControlInstance Large32BitData Inherits Canvas
End Control
Control Large8BitMask Inherits Canvas
ControlInstance Large8BitMask Inherits Canvas
End Control
Control Small1BitMask Inherits Canvas
ControlInstance Small1BitMask Inherits Canvas
End Control
Control Small4BitData Inherits Canvas
ControlInstance Small4BitData Inherits Canvas
End Control
Control Small8BitData Inherits Canvas
ControlInstance Small8BitData Inherits Canvas
End Control
Control Small32BitData Inherits Canvas
ControlInstance Small32BitData Inherits Canvas
End Control
Control Small8BitMask Inherits Canvas
ControlInstance Small8BitMask Inherits Canvas
End Control
Control status Inherits Label
ControlInstance status Inherits Label
End Control
Control Large1BitData Inherits Canvas
ControlInstance Large1BitData Inherits Canvas
End Control
Control Small1BitData Inherits Canvas
ControlInstance Small1BitData Inherits Canvas
End Control
Control Huge1BitData Inherits Canvas
ControlInstance Huge1BitData Inherits Canvas
End Control
Control Icon256 Inherits Canvas
ControlInstance Icon256 Inherits Canvas
End Control
Control Mask256 Inherits Canvas
ControlInstance Mask256 Inherits Canvas
End Control
Control Icon512 Inherits Canvas
ControlInstance Icon512 Inherits Canvas
End Control
Control Mask512 Inherits Canvas
ControlInstance Mask512 Inherits Canvas
End Control
Control Icon1024 Inherits Canvas
ControlInstance Icon1024 Inherits Canvas
End Control
Control Mask1024 Inherits Canvas
ControlInstance Mask1024 Inherits Canvas
End Control
Control Image1024 Inherits Canvas
ControlInstance Image1024 Inherits Canvas
End Control
Control Image256 Inherits Canvas
ControlInstance Image256 Inherits Canvas
End Control
Control Image512 Inherits Canvas
ControlInstance Image512 Inherits Canvas
End Control
EventHandler Sub DropObject(obj As DragItem, action As Integer) dim p,m as Picture do if obj.folderItemavailable then i=new IconMBS(obj.folderItem) if i<>nil and i.valid then s=i.IconFamily Thumbnail32BitData.backdrop=s.Thumbnail32BitData Thumbnail8BitMask.backdrop=s.Thumbnail8BitMask huge1BitMask.backdrop=s.huge1BitMask huge1BitData.backdrop=s.huge1BitData huge32BitData.backdrop=s.huge32BitData huge4BitData.backdrop=s.huge4BitData huge8BitData.backdrop=s.huge8BitData huge8BitMask.backdrop=s.huge8BitMask large1BitMask.backdrop=s.large1BitMask large1BitData.backdrop=s.large1BitData large32BitData.backdrop=s.large32BitData large4BitData.backdrop=s.large4BitData large8BitData.backdrop=s.large8BitData large8BitMask.backdrop=s.large8BitMask small1BitMask.backdrop=s.small1BitMask small1BitData.backdrop=s.small1BitData small32BitData.backdrop=s.small32BitData small4BitData.backdrop=s.small4BitData small8BitData.backdrop=s.small8BitData small8BitMask.backdrop=s.small8BitMask if s.GetIconImage(256,p,m) then Icon256.Backdrop=p Mask256.Backdrop=m Image256.Backdrop = Combine(p,m) end if if s.GetIconImage(512,p,m) then Icon512.Backdrop=p Mask512.Backdrop=m Image512.Backdrop = Combine(p,m) end if if s.GetIconImage(1024,p,m) then Icon1024.Backdrop=p Mask1024.Backdrop=m Image1024.Backdrop = Combine(p,m) end if status.text="" else status.text="No Icon?" beep end if end if loop until not obj.nextItem End EventHandler
EventHandler Sub Open() acceptfileDrop "special/any" End EventHandler
Protected Function Combine(p as Picture, m as Picture) As Picture dim q as new Picture(p.Width, p.Height, 32) q.Graphics.DrawPicture p,0,0 q.Mask.Graphics.DrawPicture m,0,0 Return q End Function
Property Protected i As iconMBS
Property Protected s As iconfamilyMBS
End Class
MenuBar Menu
MenuItem UntitledMenu3 = ""
MenuItem UntitledMenu2 = "File"
MenuItem FileQuit = "Quit"
MenuItem UntitledMenu0 = "Edit"
MenuItem EditUndo = "Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Cut"
MenuItem EditCopy = "Copy"
MenuItem EditPaste = "Paste"
MenuItem EditClear = "Clear"
End MenuBar
Class App Inherits Application
End Class
End Project

See also:

Feedback, Comments & Corrections

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




Links
MBS Xojo tutorial videos