Platforms to show: All Mac Windows Linux Cross-Platform
PictureToJPEGStringMBS(pic as picture, quality as Integer = 80) as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
global method | JPEG | MBS Images Plugin | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This methods saves 32bit pictures to a file using JPEG Compression. Using the parameter you can specify the quality in range between 25 and 100%
The picture should be a bitmap picture without alpha channel or mask.
Use the JPEGExporterMBS class for more options.
The returned string has the encoding set to binary (no encoding). 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.
The picture is always encoded with 72 dpi. If you want to set a different dpi value, please use the JPEGExporterMBS class.
Some examples using this global method:
- /CURL/Google Mail/Send email for google mail
- /CURL/Send Email/older examples/CURLS send email with images
- /CURL/Send Email/Send email
- /Images/JPEG/JPEG Thread Test
- /Images/JPEG/JPEGToString example
- /Images/JPEG/Test on damaged JPEGs
- /Images/JPEG/Turbo JPEG Test
- /MacCocoa/Addressbook/Add person
- /MacCocoa/NSImage/NSImageMBS multithreading
- /Picture/Picture To String
Some FAQ entries about this method:
Xojo Developer Magazine
The items on this page are in the following plugins: MBS Images Plugin.