Platforms to show: All Mac Windows Linux Cross-Platform
/Images/Tiff/ScanlinesScaled test
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/ScanlinesScaled test
This example is the version from Sat, 8th Feb 2019.
Project "ScanlinesScaled test.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
EventHandler Sub Open()
// run test for all possible values
// remove every nth line
test 1 // every line, so stays
test 2
test 3
test 4
test 5
test 6
test 7
test 8
self.AutoQuit = true
End EventHandler
Sub test(n as integer)
dim t as new TiffPictureMBS
dim f as FolderItem = SpecialFolder.Desktop.Child("input.tif")
if t.Open(f) then
dim IsTiled as Boolean = t.IsTiled
dim RowsPerStrip as integer = t.RowsPerStrip
// get memory block with n rows reduced to 1
dim m4 as MemoryBlock = t.ScanlinesScaled(0, t.Height, 0, n)
dim RowCount as integer = m4.size / t.BytesPerRow
dim d as FolderItem = SpecialFolder.Desktop.Child("test"+str(n)+".tif")
dim dt as TiffPictureMBS
dim i,h as integer
dim st as TiffPictureMBS = t
dt=new TiffPictureMBS
if not dt.Create(d) then
break
else
// first
dt.Width=st.Width
dt.Height=RowCount
dt.BitsPerSample=st.BitsPerSample
dt.SamplesPerPixel=st.SamplesPerPixel
dt.Compression=st.Compression
dt.PlanarConfig=st.PlanarConfig
dt.Photometric=st.Photometric
dt.RowsPerStrip=st.RowsPerStrip
dt.FillOrder=st.FillOrder
// later
dt.Copyright=st.Copyright
dt.DateTime=st.DateTime
dt.DocumentName=st.DocumentName
dt.ExtraSamples=st.ExtraSamples
dt.HorizontalPosition=st.HorizontalPosition
dt.HorizontalResolution=st.HorizontalResolution
dt.HostComputer=st.HostComputer
dt.ImageDescription=st.ImageDescription
dt.Make=st.Make
dt.Model=st.Model
dt.Orientation=st.Orientation
dt.PageName=st.PageName
dt.ResolutionUnit=st.ResolutionUnit
dt.Software=st.Software
dt.VerticalPosition=st.VerticalPosition
dt.VerticalResolution=st.VerticalResolution
dt.Scanlines(0,RowCount)=m4
dt.Close
end if
end if
End Sub
End Class
MenuBar MainMenuBar
MenuItem FileMenu = "&File"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem EditSeparator1 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "#App.kEditClear"
MenuItem EditSeparator2 = "-"
MenuItem EditSelectAll = "Select &All"
End MenuBar
End Project
The items on this page are in the following plugins: MBS Images Plugin.