Platforms to show: All Mac Windows Linux Cross-Platform

/Compression/zip images
Feedback.

Function:
You find this example project in your Plugins Download as a Realbasic project file within the examples folder: /Compression/zip images
This example is the version from Thu, 23th Dec 2009.
Notes: Last modified: Thu, 23th Dec 2009
Class Window1
Inherits Window
// Event implementations
Sub Open()
dim z as ZipMBS
dim f as FolderItem

f=SpecialFolder.Desktop.Child("test.zip")

MakeTestFiles

z=new ZipMBS(f,0)

AddFile z, SpecialFolder.Desktop.Child("test.jpg")
AddFile z, SpecialFolder.Desktop.Child("test.png")




z.Close("global comment")
End Sub

// Methods
Sub AddFile(z as ZipMBS, f as FolderItem)
dim b as BinaryStream
dim info as ZipFileInfoMBS
dim d as date

b=f.OpenAsBinaryFile(false)

d=f.ModificationDate
info=new ZipFileInfoMBS
info.Day=d.day
info.Month=d.Month-1
info.Year=d.Year
info.Minute=d.Minute
info.hour=d.hour
info.Second=d.Second

info.ExternalFileAttributes=0
info.InternalFileAttributes=0
info.DosDate=0

z.CreateFile f.name, info, "", "", f.CommentMBS, z.MethodDeflated, z.CompressionBestCompression
while not b.EOF
z.Write b.Read(100000)
wend
z.CloseFile
End Sub
Sub MakeTestFiles()
dim f as FolderItem
dim p as Picture

p=LogoMBS(500)
f=SpecialFolder.Desktop.Child("test.jpg")
f.SaveAsJPEG p

f=SpecialFolder.Desktop.Child("test.png")
call f.SaveAsPNGMBS(p,0)



End Sub
End Class

Class App
Inherits Application
End Class


See also:




Links
MBS Realbasic Plugins - Pfarrgemeinde Messdiener Nickenich