Platforms to show: All Mac Windows Linux Cross-Platform

Back to JPEGExporterMBS class.

JPEGExporterMBS.data as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The destination string.

If file is nil, the compressed data is saved in this property.

The returned string has the encoding set to MacRoman. If you want to concat the string with another you should change the encoding, so both strings have the same encoding. If you don't handle that RB may convert the JPEG data to UTF8 (Unicode) which will destroy it.
(Read and Write property)

JPEGExporterMBS.DCTMethod as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin 15.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Which DCT/IDCT algorithm to use.

Possible values:
-1Plugin does not change setting
0slow but accurate integer algorithm (default)
1faster, less accurate integer method
2floating-point: accurate, fast on fast Hardware
Default is Integer slow.
(Read and Write property)

JPEGExporterMBS.ErrorCode as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The error code from the Export method.
Example
dim j as new JPEGExporterMBS

// do something

MsgBox str(j.ErrorCode)+" "+j.ErrorMessage

The last function was successfull if ErrorCode is 0.
If the parameters are not valid, the value is set to -1.
Other values are Mac OS error codes.
(Read and Write property)

JPEGExporterMBS.ErrorMessage as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The last error message reported.
Example
dim j as new JPEGExporterMBS

// do something

MsgBox j.ErrorMessage

(Read and Write property)

JPEGExporterMBS.EXIFData as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin 10.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The EXIF data for this file.
Example
// Read a picture file
dim f as FolderItem = SpecialFolder.Desktop.Child("test.jpg")
dim ji as new JPEGImporterMBS

ji.ReadExifData=true
ji.File=f
ji.Import

// Write a new picture file
dim o as FolderItem = SpecialFolder.Desktop.Child("out.jpg")
dim je as new JPEGExporterMBS

je.File=o
je.EXIFData = ji.ExifData
je.Picture = ji.Picture
je.Export

The export methods use this property.
(Read and Write property)

JPEGExporterMBS.file as folderitem

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The destination file.
Example
dim p as Picture = LogoMBS(500)

'Save the scan
dim je as new JPEGExporterMBS
je.file = SpecialFolder.Desktop.Child("just a test.jpg")
je.quality = 75
je.picture = p
je.VerticalResolution = 72
je.HorizontalResolution = 72
je.ResolutionUnit = 1
je.export

If file is nil and path is "", the destination is the data property.
(Read and Write property)

JPEGExporterMBS.HorizontalResolution as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin 3.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The horizontal resolution.
Example
dim j as new JPEGExporterMBS

// setup 300 dpi
j.VerticalResolution = 300
j.HorizontalResolution = 300
j.ResolutionUnit = 1

(Read and Write property)

JPEGExporterMBS.OptimizeCoding as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin 10.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether the plugin should ask the compressor to optimize the huffman coding tables.
Example
dim j as new JPEGExporterMBS
j.OptimizeCoding = true

This usually provides a small percentage decrease in file size.
(Read and Write property)

JPEGExporterMBS.Path as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin 19.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The destination file.
Example
Dim p As Picture = LogoMBS(500)

'Save the scan
Dim je As New JPEGExporterMBS

// using file
'je.file = SpecialFolder.Desktop.Child("just a test via file.jpg")

// using path
Dim f As folderitem = SpecialFolder.Desktop.Child("just a test via path.jpg")
Dim pa As String = f.NativePath
je.path = pa

je.quality = 75
je.picture = p
je.VerticalResolution = 72
je.HorizontalResolution = 72
je.ResolutionUnit = 1
je.export

If file is nil and path is "", the destination is the data property.
(Read and Write property)

JPEGExporterMBS.Picture as Picture

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The picture to use.
Example
dim MyPic as Picture = LogoMBS(500)
dim j as JPEGExporterMBS // your exporter
j.picture=MyPic

Should be a bitmap picture without alpha channel or mask.
(Read and Write property)

JPEGExporterMBS.ProfileData as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin 7.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
An ICC profile to write to the file.
Example
dim f as FolderItem
dim j as JPEGImporterMBS
dim p as LCMS2ProfileMBS
dim e as JPEGExporterMBS

f=SpecialFolder.Desktop.Child("test2.jpg")
j=new JPEGImporterMBS

j.ReadMarkers=true // else no metadata is read at all
j.ReadProfileData=true // needed to fill ProfileData property
j.file=f

j.Import

if j.ProfileData="" then
MsgBox "no profile"
Return
end if

p=LCMS2ProfileMBS.CreatesRGBProfile

f=SpecialFolder.Desktop.Child("test3.jpg")
e=new JPEGExporterMBS
e.File=f
e.Picture=j.Picture
e.ProfileData=p.SaveProfileToString
e.Quality=75
e.Export

the string must contain the binary data of the profile. For example SaveProfileToString of the CMProfileMBS class returns such a string.
If the string is empty, no profile is written.
(Read and Write property)

JPEGExporterMBS.Progressive as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
whether to make a progressive compressed image.
Example
dim j as new JPEGExporterMBS
j.Progressive = true

Default is true.
(Read and Write property)

JPEGExporterMBS.Quality as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The quality to use.
Example
dim je as new JPEGExporterMBS
je.quality = 75

Range from 0 to 100. Default is 75.
(Read and Write property)

JPEGExporterMBS.ResolutionUnit as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin 3.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The unit of the resolution properties.
Example
dim j as new JPEGExporterMBS

// setup 300 dpi
j.VerticalResolution = 300
j.HorizontalResolution = 300
j.ResolutionUnit = 1

Values:
0unknown
1dots per inch
2dots per cm
(Read and Write property)

JPEGExporterMBS.VerticalResolution as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin 3.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The vertical resolution.
Example
dim j as new JPEGExporterMBS

// setup 300 dpi
j.VerticalResolution = 300
j.HorizontalResolution = 300
j.ResolutionUnit = 1

(Read and Write property)

JPEGExporterMBS.WarningMessage as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The last warning message reported.
Example
dim j as new JPEGExporterMBS

// do something

MsgBox j.WarningMessage

(Read and Write property)

JPEGExporterMBS.XMPData as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The XMP data for this file.

The export methods use this property.
(Read and Write property)

JPEGExporterMBS.YieldTicks as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin 7.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
How much time is given back to Xojo for other ticks.
Example
dim j as JPEGExporterMBS // your exporter

j.YieldTicks=6 // only use 1/10th of a second

If value is greater than zero, the application will yield to another RB thread after the given number of ticks have passed. 60 ticks are one second. Using a small value can slow down processing a lot while a big value keeps your application not responding to mouse clicks.
If you use this property with e.g. 6 as the value, you may also want to use this method in a thread so you can handle mouse events or let Xojo redraw a progressbar.
(Read and Write property)

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


The biggest plugin in space...