Xojo Developer Conference
Join us from 25th to 27th April 2018 in Denver.

Platforms to show: All Mac Windows Linux Cross-Platform

JPEGExporterMBS class

class, JPEG, MBS JPEG Plugin (JPEGCompression), class JPEGExporterMBS,
Mac: Yes, Win: Yes, Linux: Yes, Console & Web: Yes, Feedback.

Function: A class for JPEG Exporting.
Example:
dim g as FolderItem
dim ji as JPEGImporterMBS
dim je as JPEGExporterMBS
dim f as FolderItem
dim m as MemoryBlock

// this code copies a JPG: CMYK or RGB

// import it
g=SpecialFolder.Desktop.Child("PICT1533.JPG")
ji=new JPEGImporterMBS
ji.File=g
ji.AllowDamaged=true
ji.CMYK=true // if it is cmyk
if ji.InitJPEG then
do
loop until ji.LoopJPEG<>0
ji.FinishJPEG
end if

// export it
f=SpecialFolder.Desktop.child("PICT1533 copy.JPG")
je=new JPEGExporterMBS
je.File=f
je.Quality=75

if ji.CMYK then
m=ji.PictureData
je.ExportCMYK m, ji.Width, ji.Height, ji.Width*4
else
je.Picture=ji.Picture
je.Export
end if
Notes:
This class is not depending on any library! It works without QuickTime even on System 7, but as it contains everything needed this method is around 100 KB big!
(REALbasic's SaveAsJPEG depends on QuickTime)

Bases on libjpeg.

This class has no sub classes.

Some examples which use this class:


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


JPEG2000MBS   -   JPEGImporterMarkerMBS




Links
MBS Xojo PDF Plugins