Platforms to show: All Mac Windows Linux Cross-Platform
/Images/JPEG/LoadAsJPEG Example
Required plugins for this example: MBS Images Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Images/JPEG/LoadAsJPEG Example
This example is the version from Sun, 17th Mar 2012.
Project "LoadAsJPEG Example.xojo_binary_project"
FileTypes
Filetype image/jpeg
End FileTypes
Class Window1 Inherits Window
Control res Inherits Label
ControlInstance res Inherits Label
End Control
Control err Inherits Label
ControlInstance err Inherits Label
End Control
EventHandler Sub DropObject(obj As DragItem, action As Integer)
dim p as picture
dim j as JPEGImporterMBS
dim s as String
do
if obj.folderItemavailable then
j=new JPEGImporterMBS
j.file=obj.folderItem
j.Import
err.text=j.ErrorMessage
backdrop=j.Picture
Title=j.File.DisplayName+": "+str(j.Width)+" x "+str(j.Height)+" @ "+str(j.CurrentDepth)+" bits" // <-- CONVERTED
select case j.ResolutionUnit
case 0
s=" dots/?"
case 1
s=" dots/inch"
case 2
s=" dots/cm"
end Select
res.text=str(j.HorizontalResolution)+" x "+str(j.VerticalResolution)+s
end if
loop until not obj.nextItem
End EventHandler
EventHandler Sub Open()
me.acceptfileDrop "image/jpeg"
End EventHandler
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
The items on this page are in the following plugins: MBS Images Plugin.