Platforms to show: All Mac Windows Linux Cross-Platform
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 Speed Test
This example is the version from Sun, 17th Mar 2012.
Project "Tiff Speed Test.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()
dim f as FolderItem = SpecialFolder.Desktop.Child("EX119-020.tif")
if f=nil or f.Exists=false then
MsgBox "please change the path to point to another black/white tiff file!"
quit
end if
dim i,t1,t2,t3,t4,t5,t6 as integer
dim b as Boolean
dim t as MyTiff
// RGB
t=nil
t=new MyTiff
if t.Open(f) then
t3=Ticks
for i=1 to 10
b=t.ReadRGB
next
t3=ticks-t3
if not b then
MsgBox "ReadRGB failed!"
end if
else
Title="open failed"
end if
// PreviewRGB with factor 2
t=nil
t=new MyTiff
if t.Open(f) then
t4=Ticks
for i=1 to 10
b=t.ReadPreviewRGB(2)
next
t4=ticks-t4
if not b then
MsgBox "ReadPreviewRGB failed!"
else
title=str(t.Width)+" x "+str(T.Height)+" -> "+str(T.Pict.Width)+" x "+str(T.Pict.Height)
Backdrop=t.Pict
end if
else
Title="open failed"
end if
// PreviewRGB with factor 4
t=nil
t=new MyTiff
if t.Open(f) then
t5=Ticks
for i=1 to 10
b=t.ReadPreviewRGB(4)
next
t5=ticks-t5
if not b then
MsgBox "ReadPreviewRGB failed!"
else
title=str(t.Width)+" x "+str(T.Height)+" -> "+str(T.Pict.Width)+" x "+str(T.Pict.Height)
Backdrop=t.Pict
end if
else
Title="open failed"
end if
// PreviewRGB with factor 10
t=nil
t=new MyTiff
if t.Open(f) then
t6=Ticks
for i=1 to 10
b=t.ReadPreviewRGB(10)
next
t6=ticks-t6
if not b then
MsgBox "ReadPreviewRGB failed!"
else
title=str(t.Width)+" x "+str(T.Height)+" -> "+str(T.Pict.Width)+" x "+str(T.Pict.Height)
Backdrop=t.Pict
end if
else
Title="open failed"
end if
// BW
t=nil
t=new MyTiff
if t.Open(f) then
t1=Ticks
for i=1 to 10
b=t.ReadBW
next
t1=ticks-t1
if not b then
MsgBox "ReadBW failed!"
end if
else
Title="open failed"
end if
// PreviewBW
t=nil
t=new MyTiff
if t.Open(f) then
t2=Ticks
for i=1 to 10
b=t.ReadPreviewBW
next
t2=ticks-t2
if not b then
MsgBox "ReadPreviewBW failed!"
end if
if t.Pict=nil then
Title="nil!"
else
'title=str(t.Width)+" x "+str(T.Height)+" -> "+str(T.Pict.Width)+" x "+str(T.Pict.Height)
'Backdrop=t.Pict
end if
else
Title="open failed"
end if
MsgBox str(t1)+" ticks for ReadBW"+_
EndOfLine+stR(t2)+" ticks for ReadPreviewBW"+_
EndOfLine+stR(t3)+" ticks for ReadRGB"+_
EndOfLine+stR(t4)+" ticks for ReadPreviewRGB(2)"+_
EndOfLine+stR(t5)+" ticks for ReadPreviewRGB(4)"+_
EndOfLine+stR(t6)+" ticks for ReadPreviewRGB(10)"
End EventHandler
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
Class MyTiff Inherits TiffPictureMBS
EventHandler Sub Error(libModule as string, message as string)
MsgBox Message
End EventHandler
EventHandler Sub Warning(libModule as string, message as string)
'MsgBox Message
End EventHandler
End Class
End Project
See also:
The items on this page are in the following plugins: MBS Images Plugin.