Example: /Images/Tiff/Huge Tiff

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/Huge Tiff


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/Huge Tiff

This example is the version from Wed, 8th Jan 2019.

Project "Huge Tiff.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
EventHandler Sub Open() Write read End EventHandler
Sub read() // read big tiff row by row dim t as TiffPictureMBS dim f as FolderItem = SpecialFolder.Desktop.Child("test.tif") if f<>Nil then t=new TiffPictureMBS if t.Open(f) then dim row as MemoryBlock dim h as integer=t.Height-1 for i as integer=0 to h row=t.Scanline(i) next t.Close MsgBox "Read TIFF file." end if end if End Sub
Sub write() // write big tiff row by row ' const x = 20000 // 1.2 GB const x = 30000 // 2.7 GB dim f as FolderItem dim t as TiffPictureMBS f=SpecialFolder.Desktop.Child("test.tif") if f<>Nil then t=new TiffPictureMBS if x > 30000 then // big tiff if not t.open(f, "w8") then MsgBox "Failed to create file. Check path and write permissions." end if else // normal tiff if not t.Create(f) then MsgBox "Failed to create file. Check path and write permissions." end if end if const PLANARCONFIG_CONTIG=1 const PHOTOMETRIC_RGB=2 const FILLORDER_MSB2LSB=1 const RESUNIT_INCH=2 const ORIENTATION_TOPLEFT=1 const COMPRESSION_NONE=1 t.Height=x t.Width=x t.RowsPerStrip=1 t.PlanarConfig=PLANARCONFIG_CONTIG t.Photometric=PHOTOMETRIC_RGB t.BitsPerSample=8 t.SamplesPerPixel=3 t.FillOrder=FILLORDER_MSB2LSB t.Orientation=ORIENTATION_TOPLEFT t.ResolutionUnit=RESUNIT_INCH t.VerticalResolution=72.0 t.HorizontalResolution=72.0 t.Compression=COMPRESSION_NONE dim row as MemoryBlock = NewMemoryBlock(t.Width * 3) dim h as integer=t.Height-1 for i as integer=0 to h t.Scanline(i)=row next t.Close MsgBox "Wrote TIFF file." 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

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


💬 Ask a question or report a problem