Example: /Images/Tiff/Tiff Write Gray Test

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

/Images/Tiff/Tiff Write Gray Test


Required plugins for this example: MBS Images Plugin, MBS Main Plugin

You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Images/Tiff/Tiff Write Gray Test

This example is the version from Mon, 15th Nov 2020.

Project "Tiff Write Gray Test.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
EventHandler Sub Open() dim logo as Picture = LogoMBS(500) 'logo = logo.GrayScaleMBS(1) WriteTiff logo, 0, 0 // defaults WriteTiff logo, 8, TiffPictureMBS.kPhotometricMinIsWhite WriteTiff logo, 16, TiffPictureMBS.kPhotometricMinIsWhite WriteTiff logo, 8, TiffPictureMBS.kPhotometricMinIsBlack WriteTiff logo, 16, TiffPictureMBS.kPhotometricMinIsBlack AutoQuit = true End EventHandler
Sub WriteTiff(pic as Picture, Bits as integer, Photometric as integer) dim f as FolderItem dim t as TiffPictureMBS dim bitsString as string Select case bits case 8 bitsString = "8 Bit" case 16 bitsString = "16 Bit" case 0 bitsString = "default" else break end Select dim PhotometricString as string Select case Photometric case TiffPictureMBS.kPhotometricMinIsBlack PhotometricString = "MinIsBlack" case TiffPictureMBS.kPhotometricMinIsWhite PhotometricString = "MinIsWhite" case 0 PhotometricString = "default" else break end Select dim name as string = "test "+bitsString+" "+PhotometricString+".tiff" System.DebugLog name f = SpecialFolder.Desktop.Child(name) if f<>Nil then t=new TiffPictureMBS if t.Create(f) then t.Pict=pic if Photometric<>0 then t.Photometric = Photometric end if if bits<>0 then t.BitsPerSample = bits end if if t.WriteGray then // ok else break MsgBox "Failed to write tiff file "+f.Name end if t.Close end if end if End Sub
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&Ablage"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Bearbeiten"
MenuItem EditUndo = "&Rückgängig"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "&Ausschneiden"
MenuItem EditCopy = "&Kopieren"
MenuItem EditPaste = "&Einfügen"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "&Alles auswählen"
End MenuBar
End Project

See also:

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


💬 Ask a question or report a problem