Xojo Conferences

Platforms to show: All Mac Windows Linux Cross-Platform

/Images/Tiff/Tiff WriteBW Tests
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/Tiff/Tiff WriteBW Tests
This example is the version from Sun, 10th Dec 2016.
Project "Tiff WriteBW Tests.rbp"
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
EventHandler Sub Open() dim p as Picture p = new Picture(300,300,32) p.Graphics.FillOval 0,0,300,300 Backdrop=p const PHOTOMETRIC_MINISWHITE = 0 //* min value is white */ const PHOTOMETRIC_MINISBLACK = 1 //* min value is black */ const FILLORDER_MSB2LSB = 1 //* most significant -> least */ const FILLORDER_LSB2MSB = 2 //* least significant -> most */ WriteTiff p, "default default", -1, -1 WriteTiff p, "MSB default", FILLORDER_MSB2LSB, -1 WriteTiff p, "LSB default", FILLORDER_LSB2MSB, -1 WriteTiff p, "default White", -1, PHOTOMETRIC_MINISWHITE WriteTiff p, "MSB White", FILLORDER_MSB2LSB, PHOTOMETRIC_MINISWHITE WriteTiff p, "LSB White", FILLORDER_LSB2MSB, PHOTOMETRIC_MINISWHITE WriteTiff p, "default Black", -1, PHOTOMETRIC_MINISBLACK WriteTiff p, "MSB Black", FILLORDER_MSB2LSB, PHOTOMETRIC_MINISBLACK WriteTiff p, "LSB Black", FILLORDER_LSB2MSB, PHOTOMETRIC_MINISBLACK End EventHandler
Function FindFile(name as string) As FolderItem // Look for file in parent folders from executable on dim parent as FolderItem = app.ExecutableFile.Parent while parent<>Nil dim file as FolderItem = parent.Child(name) if file<>Nil and file.Exists then Return file end if parent = parent.Parent wend End Function
Sub WriteTiff(p as picture, name as string, fillorder as integer, photometric as integer) dim t as new TiffPictureMBS dim f as FolderItem f=FindFile("Tiff WriteBW "+name+".tiff") if t.Create(f) then t.Pict=p if fillorder>=0 then t.FillOrder=fillorder end if if photometric>=0 then t.Photometric=photometric end if if not t.WriteBW then MsgBox "WriteBW failed." end if t.Close else MsgBox "Failed to create file "+f.Name end if End Sub
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&File"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "Select &All"
End MenuBar
End Project

See also:

Feedback, Comments & Corrections

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

MBS Xojo Plugins