Platforms to show: All Mac Windows Linux Cross-Platform

/Encryption/Base 64/Base64 and JPEG


Required plugins for this example: MBS Encryption Plugin, MBS Picture Plugin, MBS Images Plugin

You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Encryption/Base 64/Base64 and JPEG

This example is the version from Tue, 23th May 2016.

Project "Base64 and JPEG.xojo_binary_project"
FileTypes
Filetype special/any
End FileTypes
Class Window1 Inherits Window
Control StaticText1 Inherits Label
ControlInstance StaticText1 Inherits Label
End Control
Control Canvas1 Inherits Canvas
ControlInstance Canvas1 Inherits Canvas
End Control
Control StaticText2 Inherits Label
ControlInstance StaticText2 Inherits Label
End Control
EventHandler Sub DropObject(obj As DragItem, action As Integer) do if obj.FolderItemAvailable then run obj.FolderItem end if loop until not obj.NextItem End EventHandler
EventHandler Sub Open() AcceptFileDrop "special/any" End EventHandler
Sub run(f as folderItem) dim p as Picture dim ot as TextOutputStream dim it as TextInputStream dim s as String dim ff as FolderItem p=f.OpenAsPicture if p=nil then it=f.OpenAsTextFile s=it.ReadAll it.Close s=DecodeBase64MBS(s) p=JPEGStringToPictureMBS(s,false) Canvas1.Backdrop=p else p=p.BitmapMBS s=PictureToJPEGStringMBS(p,90) s=EncodeBase64MBS(s,72,chr(13)) if TargetMacOS then ff=f.Parent.Child("mac base64 "+f.name) else ff=f.Parent.Child("win base64 "+f.name) end if ot=ff.CreateTextFile ot.Write s ot.Close MsgBox "saved to "+ff.name 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

See also:

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


The biggest plugin in space...