Platforms to show: All Mac Windows Linux Cross-Platform

PictureMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Large Picture MBS Images Plugin 8.7 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The MBS picture class for really large pictures.
Example
dim fSource as FolderItem = SpecialFolder.Desktop.Child("test.png") // some png with alpha
dim oPNGInput as new PNGReaderMBS

If oPNGInput.OpenFile(fSource) Then
If oPNGInput.ApplyOptions(0) Then

dim imgSource as New PictureMBS(oPNGInput.Width, oPNGInput.Height, PictureMBS.ImageFormatRGBA)

' Read row by row the file and puts it in a PictureMBS instance

dim nMax as Integer = oPNGInput.Height - 1
For nInd as Integer = 0 To nMax
imgSource.RowInFormat(nInd, PictureMBS.ImageFormatRGBA, true) = oPNGInput.ReadRow()
Next

' show only alpha/mask channel
Backdrop=imgSource.AlphaChannel.CopyPicture

' show Picture without mask
Backdrop=imgSource.CopyPicture

' show picture with mask
Backdrop=imgSource.CopyPictureWithMask

End If
End If

Using virtual memory you are only limited to hard disc space for swapping.

The Xojo picture class is limited to 2 GB and to width/height being in platform specific ranges. This class works with pictures up to 100 million pixels width and 2 billion pixels height.

  • 53 properties
  • 133 methods
    • method AlphaChannel as PictureMBS
    • method ApplyMatrix(dest as PictureMBS, MatrixDimension as Integer, matrix() as Integer) as PictureMBS
    • method ApplyMatrix(dest as PictureMBS, MatrixDimension as Integer, matrix() as Integer, delta as Integer) as PictureMBS
    • method ApplyMatrix(dest as PictureMBS, MatrixDimension as Integer, matrix() as Integer, delta as Integer, ScaleFactor as Double) as PictureMBS
    • method AutoLevel as boolean
    • method AutoLevel(x as Integer, y as Integer, w as Integer, h as Integer) as boolean
    • method BlackChannel as PictureMBS
    • method BlueChannel as PictureMBS
    • method BoxBlurFilter(dest as PictureMBS, Radius as Double, Iterations as Integer, Vertical as boolean = true, Horizontal as boolean = true) as PictureMBS
    • method BoxBlurFilter(dest as PictureMBS, Radius as Double, Vertical as boolean = true, Horizontal as boolean = true) as PictureMBS
    • method BoxBlurFractionalFilter(dest as PictureMBS, Radius as Double) as PictureMBS
    • method Channel(index as Integer) as PictureMBS
    • method ChannelOffset(index as integer) as integer
    • method Channels as String()
    • method ClearCache
    • method ClearRect
    • method ClearRect(x as Integer, y as Integer, width as Integer, height as Integer)
    • method ClipImage as PictureMBS
    • method ClipImage(x as Integer, y as Integer, width as Integer, height as Integer) as PictureMBS
    • method Clone as PictureMBS
    • method Close
    • method CMYKChannels as PictureMBS
    • method Combine(Image As PictureMBS, Mask As PictureMBS, DestX as Integer, DestY as Integer, SourceX as Integer, SourceY as Integer, Width as Integer, Height as Integer, UseColours As Boolean) as boolean
    • method Combine(Image As PictureMBS, Mask As PictureMBS, DestX as Integer, DestY as Integer, SourceX as Integer, SourceY as Integer, Width as Integer, Height as Integer, UseColours As Boolean, ForeColour As color) as boolean
    • method Combine(Image As PictureMBS, Mask As PictureMBS, DestX as Integer, DestY as Integer, SourceX as Integer, SourceY as Integer, Width as Integer, Height as Integer, UseColours As Boolean, ForeColour As color, MaskColour As color) as boolean
    • method Combine(Image As PictureMBS, Mask As PictureMBS, DestX as Integer, DestY as Integer, SourceX as Integer, SourceY as Integer, Width as Integer, Height as Integer, UseColours As Boolean, ForeColour as Integer) as boolean
    • method Combine(Image As PictureMBS, Mask As PictureMBS, DestX as Integer, DestY as Integer, SourceX as Integer, SourceY as Integer, Width as Integer, Height as Integer, UseColours As Boolean, ForeColour as Integer, MaskColour as Integer) as boolean
    • method Combine(Image As PictureMBS, PreMultipliedSource as boolean, Mask As PictureMBS, DestX as Integer, DestY as Integer, SourceX as Integer, SourceY as Integer, Width as Integer, Height as Integer, UseColours As Boolean) as boolean
    • method Combine(Image As PictureMBS, PreMultipliedSource as boolean, Mask As PictureMBS, DestX as Integer, DestY as Integer, SourceX as Integer, SourceY as Integer, Width as Integer, Height as Integer, UseColours As Boolean, ForeColour As color) as boolean
    • method Combine(Image As PictureMBS, PreMultipliedSource as boolean, Mask As PictureMBS, DestX as Integer, DestY as Integer, SourceX as Integer, SourceY as Integer, Width as Integer, Height as Integer, UseColours As Boolean, ForeColour As color, MaskColour As color) as boolean
    • method Combine(Image As PictureMBS, PreMultipliedSource as boolean, Mask As PictureMBS, DestX as Integer, DestY as Integer, SourceX as Integer, SourceY as Integer, Width as Integer, Height as Integer, UseColours As Boolean, ForeColour as Integer) as boolean
    • method Combine(Image As PictureMBS, PreMultipliedSource as boolean, Mask As PictureMBS, DestX as Integer, DestY as Integer, SourceX as Integer, SourceY as Integer, Width as Integer, Height as Integer, UseColours As Boolean, ForeColour as Integer, MaskColour as Integer) as boolean
    • method Combine(Mask As PictureMBS, X as Integer, Y as Integer, Width as Integer, Height as Integer, BackColour As color) as boolean
    • method CompareImages(other as PictureMBS) as Int64
    • method Constructor(Buf as MemoryBlock, width as Integer, height as Integer, ImageFormat as Integer, RowSize as Integer)
    • method Constructor(pic as picture, UseAlpha as boolean=false)
    • method Constructor(width as Integer, height as Integer, ImageFormat as Integer)
    • method Constructor(width as Integer, height as Integer, ImageFormat as Integer, BlockSize as Int64, FilePath as folderitem)
    • method CopyMask as picture
    • method CopyMask(x as Integer, y as Integer, w as Integer, h as Integer) as picture
    • method CopyPicture as picture
    • method CopyPicture(x as Integer, y as Integer, w as Integer, h as Integer) as picture
    • method CopyPictureWithAlpha as picture
    • method CopyPictureWithAlpha(x as integer, y as integer, w as integer, h as integer) as picture
    • method CopyPictureWithMask as picture
    • method CopyPictureWithMask(x as Integer, y as Integer, w as Integer, h as Integer) as picture
    • method CopyPixels(source as PictureMBS) as boolean
    • method CopyPixels(source as PictureMBS, DestX as Integer, DestY as Integer, DestWidth as Integer, DestHeight as Integer) as boolean
    • method CopyPixels(source as PictureMBS, DestX as Integer, DestY as Integer, DestWidth as Integer, DestHeight as Integer, SourceX as Integer, SourceY as Integer) as boolean
    • method CreatePictureMBS(width as Integer, height as Integer, ImageFormat as Integer) as PictureMBS
    • method CyanChannel as PictureMBS
    • method DiffuseFilter(dest as PictureMBS, level as Integer) as PictureMBS
    • method DitherFilter(dest as PictureMBS, matrix as Integer, levels as Integer) as PictureMBS
    • method DrawMaskedPictureApplyMaskRGB(pic as picture, DestX as Integer, DestY as Integer, DestWidth as Integer, DestHeight as Integer, InvertMask as boolean=False)
    • method DrawMaskedPictureApplyMaskRGB(pic as picture, DestX as Integer, DestY as Integer, DestWidth as Integer, DestHeight as Integer, SourceX as Integer, SourceY as Integer, InvertMask as boolean=False)
    • method DrawMaskedPictureApplyMaskRGB(pic as picture, DestX as Integer, DestY as Integer, InvertMask as boolean=False)
    • method DrawMaskedPictureApplyMaskRGB(pic as picture, InvertMask as boolean=False)
    • method DrawMaskedPictureRGB(pic as picture, DestX as Integer, DestY as Integer, DestWidth as Integer, DestHeight as Integer, InvertMask as boolean=False)
    • method DrawMaskedPictureRGB(pic as picture, DestX as Integer, DestY as Integer, DestWidth as Integer, DestHeight as Integer, SourceX as Integer, SourceY as Integer, InvertMask as boolean=False)
    • method DrawMaskedPictureRGB(pic as picture, DestX as Integer, DestY as Integer, InvertMask as boolean=False)
    • method DrawMaskedPictureRGB(pic as picture, InvertMask as boolean=False)
    • method DrawPictureBlueToGrayChannel(pic as picture, DestX as Integer, DestY as Integer, DestWidth as Integer, DestHeight as Integer)
    • method DrawPictureBlueToGrayChannel(pic as picture, DestX as Integer, DestY as Integer, DestWidth as Integer, DestHeight as Integer, SourceX as Integer, SourceY as Integer)
    • method DrawPictureGreenToGrayChannel(pic as picture, DestX as Integer, DestY as Integer, DestWidth as Integer, DestHeight as Integer)
    • method DrawPictureGreenToGrayChannel(pic as picture, DestX as Integer, DestY as Integer, DestWidth as Integer, DestHeight as Integer, SourceX as Integer, SourceY as Integer)
    • method DrawPictureRedToGrayChannel(pic as picture, DestX as Integer, DestY as Integer, DestWidth as Integer, DestHeight as Integer)
    • method DrawPictureRedToGrayChannel(pic as picture, DestX as Integer, DestY as Integer, DestWidth as Integer, DestHeight as Integer, SourceX as Integer, SourceY as Integer)
    • method DrawPictureRGB(pic as picture)
    • method DrawPictureRGB(pic as picture, DestX as Integer, DestY as Integer)
    • method DrawPictureRGB(pic as picture, DestX as Integer, DestY as Integer, DestWidth as Integer, DestHeight as Integer)
    • method DrawPictureRGB(pic as picture, DestX as Integer, DestY as Integer, DestWidth as Integer, DestHeight as Integer, SourceX as Integer, SourceY as Integer)
    • method EngraveFilter(dest as PictureMBS, level as Integer) as PictureMBS
    • method FillRect(value as Integer)
    • method FillRect(Value as integer, Alpha as Integer)
    • method FillRect(x as Integer, y as Integer, width as Integer, height as Integer, value as Integer)
    • method FillRect(x as integer, y as integer, width as integer, height as integer, Value as integer, Alpha as Integer)
    • method FillRectApply(FillColor as color, alpha as Integer) as boolean
    • method FillRectApply(red as Integer, green as Integer, blue as Integer, alpha as Integer) as boolean
    • method FillRectApply(x as Integer, y as Integer, width as Integer, height as Integer, FillColor as color, alpha as Integer) as boolean
    • method FillRectApply(x as Integer, y as Integer, width as Integer, height as Integer, red as Integer, green as Integer, blue as Integer, alpha as Integer) as boolean
    • method FillRectRandom
    • method FillRectRandom(x as Integer, y as Integer, width as Integer, height as Integer)
    • method FillRectRGB(FillColor as color)
    • method FillRectRGB(FillColor as color, alpha as Integer)
    • method FillRectRGB(red as Integer, green as Integer, blue as Integer)
    • method FillRectRGB(red as Integer, green as Integer, blue as Integer, alpha as Integer)
    • method FillRectRGB(x as Integer, y as Integer, width as Integer, height as Integer, FillColor as color)
    • method FillRectRGB(x as Integer, y as Integer, width as Integer, height as Integer, FillColor as color, alpha as Integer)
    • method FillRectRGB(x as Integer, y as Integer, width as Integer, height as Integer, red as Integer, green as Integer, blue as Integer)
    • method FillRectRGB(x as Integer, y as Integer, width as Integer, height as Integer, red as Integer, green as Integer, blue as Integer, alpha as Integer)
    • method GainFilter(dest as PictureMBS, gain as Double, bias as Double) as PictureMBS
    • method GammaFilter(dest as PictureMBS, gamma as Double) as PictureMBS
    • method GammaFilter(dest as PictureMBS, gamma as Double, alphaGamma as Double) as PictureMBS
    • method GammaFilter(dest as PictureMBS, redGamma as Double, greenGamma as Double, blueGamma as Double) as PictureMBS
    • method GammaFilter(dest as PictureMBS, redGamma as Double, greenGamma as Double, blueGamma as Double, alphaGamma as Double) as PictureMBS
    • method GrayChannel as PictureMBS
    • method GreenChannel as PictureMBS
    • method HMirror
    • method Invert
    • method Invert(x as Integer, y as Integer, w as Integer, h as Integer)
    • method MagentaChannel as PictureMBS
    • method MapInRows(FirstRow as Integer, LastRow as Integer) as boolean
    • method MirroredView as PictureMBS
    • method Multiply
    • method Multiply(x as integer, y as integer, width as integer, height as integer)
    • method NeonFilter(dest as PictureMBS) as PictureMBS
    • method OilFilter(dest as PictureMBS, levels as Integer, range as Integer) as PictureMBS
    • method RawRow(index as Integer) as memoryblock
    • method RawRowPtr(index as Integer) as Ptr
    • method RedChannel as PictureMBS
    • method RGBChannels as PictureMBS
    • method RGBToGray(mode as Integer = 0) as boolean
    • method Rotate(angle as Double, Red as Integer = 0, Green as Integer = 0, Blue as Integer = 0, Alpha as Integer = 0, Gray as Integer = 0, Cyan as Integer = 0, Magenta as Integer = 0, Yellow as Integer = 0, Black as Integer = 0) as PictureMBS
    • method Rotate180
    • method Rotate180(dest as PictureMBS=nil) as PictureMBS
    • method Rotate270(dest as PictureMBS=nil) as PictureMBS
    • method Rotate270slow(dest as PictureMBS=nil) as PictureMBS
    • method Rotate90(dest as PictureMBS=nil) as PictureMBS
    • method Rotate90slow(dest as PictureMBS=nil) as PictureMBS
    • method Scale(source as PictureMBS, temp as PictureMBS, mode as Integer, width as Integer, height as Integer) as boolean
    • method ScaleFast(source as PictureMBS, width as Integer, height as Integer) as boolean
    • method ScaleMT(threads as Integer, source as PictureMBS, temp as PictureMBS, mode as Integer, width as Integer, height as Integer) as boolean
    • method SolarizeFilter(dest as PictureMBS) as PictureMBS
    • method StampFilter(dest as PictureMBS, radius as Double, threshold as Double, softness as Double, Black as Color, White as Color) as PictureMBS
    • method TransferFilter(dest as PictureMBS, gray() as Integer) as PictureMBS
    • method TransferFilter(dest as PictureMBS, gray() as Integer, alpha() as Integer) as PictureMBS
    • method TransferFilter(dest as PictureMBS, red() as Integer, green() as Integer, blue() as Integer) as PictureMBS
    • method TransferFilter(dest as PictureMBS, red() as Integer, green() as Integer, blue() as Integer, alpha() as Integer) as PictureMBS
    • method Unmultiply
    • method Unmultiply(x as integer, y as integer, width as integer, height as integer)
    • method UnsharpFilter(origpixels as PictureMBS, Amount as Double, Threshold as Integer) as boolean
    • method VMirror
    • method YellowChannel as PictureMBS
  • 5 shared methods
    • shared method BlendPicturesWithMaskWithBackground(SourceImage as PictureMBS, DestImage as PictureMBS, Mask as PictureMBS, Result as PictureMBS, BackgroundColour as Color) as Boolean
    • shared method BlendPicturesWithMaskWithBackground(SourceImage as PictureMBS, DestImage as PictureMBS, Mask as PictureMBS, Result as PictureMBS, BackgroundColour as Color, X As Integer, Y As Integer, Width As Integer, Height As Integer) as Boolean
    • shared method CalculateMemory(width as Integer, height as Integer, theImageFormat as Integer) as Int64
    • shared method CanAllocateImage(width as Integer, height as Integer, theImageFormat as Integer) as boolean
    • shared method CreatePictureMBS(width as Integer, height as Integer, theImageFormat as Integer) as PictureMBS
  • 88 constants

This class has no sub classes.

Some methods using this class:

Some properties using for this class:

Some events using this class:

Some examples using this class:

Blog Entries

Xojo Developer Magazine

Videos

Release notes

  • Version 20.2
    • Added ChannelOffset() to PictureMBS class.
    • Added more kImageFormatG* constants for PictureMBS class to hold image data with 1 to 8 channels.
  • Version 19.3
    • Changed PictureMBS to allow more effects with mapped pictures. But performance may be slow.
  • Version 19.1
  • Version 18.1
    • Added check for PictureMBS.DataStringInFormat to raise exception if you try to request too big memory blocks.
    • Added PictureMBS.Channel and PictureMBS.Channels for color channel names.
    • Fixed bug in PictureMBS.MapInRows. Now returns error instead of freezing app is trying to allocate > 2GB in 32-bit application.
  • Version 18.0
    • Added Multiply and Unmultiply to PictureMBS class.
    • Added PictureMBS.BlendPicturesWithMaskWithBackground function.
    • Added PictureMBS.ClearCache.
    • Added PictureMBS.CopyPictureWithAlpha function.
    • Added PictureMBS.FillRect with alpha.
    • Fixed issue where PictureMBS.ChannelCount was not set in all cases when creating one from a Xojo picture.
  • Version 17.2
    • Added PictureMBS MapInRows and RawRowPtr function.

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


PictureMatrixMBS   -   PictureMinMaxMBS


The biggest plugin in space...