Platforms to show: All Mac Windows Linux Cross-Platform

/Images/JPEG/StringToJPEG 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/StringToJPEG Example

This example is the version from Sun, 17th Mar 2012.

Project "StringToJPEG Example.xojo_binary_project"
FileTypes
Filetype image/jpeg
Filetype image/jpeg2
End FileTypes
Class LoadWindow Inherits Window
EventHandler Sub DropObject(obj As DragItem, action As Integer) do if obj.folderItemavailable then load obj.folderItem end if loop until not obj.nextItem End EventHandler
EventHandler Sub Open() me.acceptFileDrop "image/jpeg" End EventHandler
Sub load(f as folderItem) dim s as string dim b as binaryStream dim j as JPEGImporterMBS // Read data from file into string b=f.openasbinaryFile(false) if b<>nil then s=b.read(b.length) b.close // Make a picture... j=new JPEGImporterMBS j.Data=s j.AllowDamaged=true j.Import backdrop=j.Picture title=f.displayName+": "+str(j.Width)+" x "+str(j.Height)+" with "+str(j.CurrentDepth)+" bits" end if End Sub
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.


The biggest plugin in space...