Platforms to show: All Mac Windows Linux Cross-Platform

Back to LCMS2BitmapMBS class.

LCMS2BitmapMBS.Constructor(p as picture, left as Integer, top as Integer, width as Integer, height as Integer, bits as Integer = 8)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LCMS2 MBS Images Plugin 13.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a new bitmap based on the pictures.
Example
// convert small part of picture to bitmap
dim b as new LCMS2BitmapMBS(pic, 50, 50, 100, 100)
// convert to picture
Backdrop = b.Picture

Picks only the provided area from the source picture.
Bits can be 8, 16 or 32 bit integers.

See also:

LCMS2BitmapMBS.Constructor(width as Integer, height as Integer, colorspace as Integer, RowBytes as Integer, data as memoryblock)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LCMS2 MBS Images Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a bitmap object with given size and color space.

In this variant, you pass the memoryblock with right size.
Passing memoryblock of wrong size can lead into crashs.
Raises exception if colorspace is invalid.

See also:

LCMS2BitmapMBS.CopyToPicture(pic as picture, x as Integer = 0, y as Integer = 0) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LCMS2 MBS Images Plugin 13.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Copies image data into an existing picture.
Example
// convert small part of picture to bitmap
dim b as new LCMS2BitmapMBS(pic)

// create destination picture
dim pic as new Picture(500, 500, 32)

// copy pixels and show
if b.CopyToPicture(pic, 50, 50) then

Backdrop = pic
end if

This may be more efficient for you if you process a lot of image data as you can avoid creating new picture objects with using Picture method in this class.
May not work for all pictures, especially may fail on Linux.
Returns true on success.

LCMS2BitmapMBS.Invert

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LCMS2 MBS Images Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Inverts the bitmap data.

Requires correct settings for rowbytes, height and data properties.

LCMS2BitmapMBS.Picture(HasAlpha as Boolean = false) as picture

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LCMS2 MBS Images Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a copy of the picture.
Example
// get some picture
dim logo as Picture = LogoMBS(500)

// let us convert it to a 16 bit memory block
dim l as new LCMS2BitmapMBS(logo, 16)

// check bit depth
Title = str(l.Bits)

// convert back
dim p as Picture = l.Picture

// and display
Backdrop = p

This method works with 8, 16 and 32 bit integer pictures. Make sure bits property is set.

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


The biggest plugin in space...