Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

Previous items Next items

PictureMBS.HMirror
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Large Picture MBS Images Plugin 8.7 Yes Yes Yes Yes No
Function: Mirrors the image content horizontally (flip).
Example:
// get some picture
dim l as Picture = LogoMBS(500)
// create new image
dim p as new PictureMBS(l)
// mirror
p.HMirror
// show in window
window1.Backdrop = p.CopyPicture
Notes: Works with Gray, RGB and CMYK pictures and supports alpha channel.

Feedback, Comments & Corrections

PictureMBS.Invert
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Large Picture MBS Images Plugin 8.7 Yes Yes Yes Yes No
Function: Inverts the image data.
Notes: Works with Gray, RGB and CMYK pictures and supports alpha channel.

See also:

Feedback, Comments & Corrections

PictureMBS.Invert(x as Integer, y as Integer, w as Integer, h as Integer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Large Picture MBS Images Plugin 8.7 Yes Yes Yes Yes No
Function: Inverts the image data in the given area.
Notes: Works with Gray, RGB and CMYK pictures and supports alpha channel.

See also:

Feedback, Comments & Corrections

PictureMBS.MagentaChannel as PictureMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Large Picture MBS Images Plugin 11.0 Yes Yes Yes Yes No
Function: The magenta channel of a CMYK picture as a new PictureMBS object.
Notes:
Returns nil if this channel does not exist.
No copy is made of the actual pixel data. Modifying the channel picture will modify the original picture.
Use this function to access the pixels of the channel directly.
The resulting PictureMBS object is a grayscale picture.

Feedback, Comments & Corrections

PictureMBS.MapInRows(FirstRow as Integer, LastRow as Integer) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Large Picture MBS Images Plugin 17.2 Yes Yes Yes Yes No
Function: Maps in given row range.
Notes:
This function does nothing if given rows are already mapped in.

Fails if range is invalid, image is invalid or mapping is not possible.
Returns true if not a mapped image.

Will resize memory buffer size to be big enough for those rows.

Feedback, Comments & Corrections

PictureMBS.MirroredView as PictureMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Large Picture MBS Images Plugin 10.1 Yes Yes Yes Yes No
Function: Creates a new PictureMBS object which draws into the existing on, but has all rows vertically mirrored.
Notes: So if the new picture draws into the first row, the change will be in the last row of the original picture.

Feedback, Comments & Corrections

PictureMBS.Multiply
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Large Picture MBS Images Plugin 18.0 Yes Yes Yes Yes No
Function: Multiplies alpha channel of whole picture.
Notes: Pictures with alpha channel must be multiplied, while pictures with mask have the alpha unmultiplied and inverse in the mask.

See also:

Feedback, Comments & Corrections

PictureMBS.Multiply(x as integer, y as integer, width as integer, height as integer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Large Picture MBS Images Plugin 18.0 Yes Yes Yes Yes No
Function: Multiplies alpha channel of a rectangle of the picture.
Notes: Pictures with alpha channel must be multiplied, while pictures with mask have the alpha unmultiplied and inverse in the mask.

See also:

Feedback, Comments & Corrections

PictureMBS.NeonFilter(dest as PictureMBS) as PictureMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Large Picture MBS Images Plugin 9.2 Yes Yes Yes Yes No
Function: Applies a neon filter to the image.
Example:
dim l as Picture = LogoMBS(500)
dim p as new PictureMBS(l)
p = p.NeonFilter(nil)
window1.Backdrop = p.CopyPicture
Notes:
if dest is nil, the picture factory is used to create a new picture.
On success dest or the new picture is returned.
If dest is not nil, it must match the size of the original picture.

Returns nil on any error.
Works with Gray, RGB and CMYK pictures and supports alpha channel.

Feedback, Comments & Corrections

PictureMBS.OilFilter(dest as PictureMBS, levels as Integer, range as Integer) as PictureMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Large Picture MBS Images Plugin 9.2 Yes Yes Yes Yes No
Function: Applies a oil filter to the image.
Example:
dim l as Picture = LogoMBS(500)
dim p as new PictureMBS(l)
p = p.OilFilter(nil,5,5)
window1.Backdrop = p.CopyPicture
Notes:
if dest is nil, the picture factory is used to create a new picture.
On success dest or the new picture is returned.
If dest is not nil, it must match the size of the original picture.

Levels must be between 0 and 256.
Range must be between 0 and min(width,height).

Returns nil on any error.
Works with Gray, RGB and CMYK pictures and supports alpha channel.

Feedback, Comments & Corrections

PictureMBS.RawRow(index as Integer) as memoryblock
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Large Picture MBS Images Plugin 9.0 Yes Yes Yes Yes No
Function: Returns a memoryblock with the data of this row.
Example:
// create new image
dim p as new PictureMBS(100,100,PictureMBS.ImageFormatRGB)
// copy row
dim m as MemoryBlock = p.RawRow(10)
// modify directly
m.FillBytesMBS(10,100,200)
// show in window
window1.Backdrop = p.CopyPicture
Notes:
This memoryblock is pointing to the original data, so any modification is applied to the picture.
Returns nil on any error.
May raise OutOfBoundsException for invalid index.

For pictures using virtual memory, this memoryblock can become invalid for the next call to any PictureMBS method!

Feedback, Comments & Corrections

PictureMBS.RawRowPtr(index as Integer) as Ptr
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Large Picture MBS Images Plugin 17.2 Yes Yes Yes Yes No
Function: Returns a Ptr pointing to the data of this row.
Notes:
This ptr is pointing to the original data, so any modification is applied to the picture.
Returns nil on any error.
May raise OutOfBoundsException for invalid index.

For pictures using virtual memory, this ptr can become invalid for the next call to any PictureMBS method!

Feedback, Comments & Corrections

PictureMBS.RedChannel as PictureMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Large Picture MBS Images Plugin 8.7 Yes Yes Yes Yes No
Function: The red channel as a new PictureMBS object.
Example:
dim p as new PictureMBS(100,100,PictureMBS.ImageFormatRGB)
dim r as PictureMBS = p.RedChannel
r.fillrect(100) // fill only red channel
Notes:
Returns nil if this channel does not exist.
No copy is made of the actual pixel data. Modifying the channel picture will modify the original picture.
Use this function to access the pixels of the channel directly.
The resulting PictureMBS object is a grayscale picture.

Feedback, Comments & Corrections

PictureMBS.RGBChannels as PictureMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Large Picture MBS Images Plugin 9.3 Yes Yes Yes Yes No
Function: The RGB channels as a new PictureMBS object.
Example:
dim p as new PictureMBS(100,100,PictureMBS.ImageFormatRGBA)
dim r as PictureMBS = p.RGBChannels
r.fillrect(100) // fill only color channels
Notes:
Returns nil if the image is not a RGB picture.
No copy is made of the actual pixel data. Modifying the channel picture will modify the original picture.
Use this function to access the RGB pixels directly without modifying an alpha channel
The resulting PictureMBS object is a RGB picture.

Feedback, Comments & Corrections

PictureMBS.RGBToGray(mode as Integer = 0) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Large Picture MBS Images Plugin 15.1 Yes Yes Yes Yes No
Function: Turns picture into grayscale.
Notes:
Only for RGB pictures and picture stays RGB, but all channels have same color.
Returns true on success and false on failure.

Modes:
0y = 0.33 * R + 0.5 * G + 0.16 * BFaster version of 3
1y = 0.375 * R + 0.5 * G + 0.125 * BFaster version of 3
2y = 0.2126 * R + 0.7152 * G + 0.0722 * BPhotometric/digital ITU-R
3y = 0.299 * R + 0.587 * G + 0.114 * BDigital CCIR601
4y = 0.300 * R + 0.588 * G + 0.112 * BFaster version of 3

Mode 2 and 3 uses doubles and mode 0, 4 and 1 use integers so they should be faster.
Still Mode 0 and 1 are just approximation formulas which trade accuracy for perfomance.

e.g. a red pixel (FF0000) will turn to 555555 in Mode 0, 5F5F5F in Mode 1, 363636 in Mode 2 and 4C4C4C in Mode 3 and 4.

Feedback, Comments & Corrections

PictureMBS.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
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Large Picture MBS Images Plugin 9.1 Yes Yes Yes Yes No
Function: Rotates the picture by the given degree.
Example:
dim l as Picture = LogoMBS(500)
dim p as new PictureMBS(l)
p = p.Rotate(30, 255, 255, 255, 255, 255)
window1.Backdrop = p.CopyPicture
Notes:
With Red, Blue, Green, Alpha and Gray specify the color of the fill color.

If dest is nil, the PictureFactoryMBS object (local on self or global) is used to create the new picture.
Works with Gray, RGB and CMYK pictures and supports alpha channel.

Feedback, Comments & Corrections

PictureMBS.Rotate180
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Large Picture MBS Images Plugin 9.1 Yes Yes Yes Yes No
Function: Rotates the picture by 180 degree.
Example:
dim l as Picture = LogoMBS(500)
dim p as new PictureMBS(l)
p.Rotate180
window1.Backdrop = p.CopyPicture
Notes:
Same as HMirror and VMirror together.

There are two Rotate180 methods. One makes a copy and one not. This one does not make a copy.

Works with Gray, RGB and CMYK pictures and supports alpha channel.

See also:

Feedback, Comments & Corrections

PictureMBS.Rotate180(dest as PictureMBS=nil) as PictureMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Large Picture MBS Images Plugin 9.1 Yes Yes Yes Yes No
Function: Rotates the picture by 180 degree.
Example:
dim l as Picture = LogoMBS(500)
dim p as new PictureMBS(l)
p = p.Rotate180
window1.Backdrop = p.CopyPicture
Notes:
If dest is nil, the PictureFactoryMBS object (local on self or global) is used to create the new picture.

Same as HMirror and VMirror together.

There are two Rotate180 methods. One makes a copy and one not. This one does make a copy.

Works with Gray, RGB and CMYK pictures and supports alpha channel.

See also:

Feedback, Comments & Corrections

PictureMBS.Rotate270(dest as PictureMBS=nil) as PictureMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Large Picture MBS Images Plugin 9.1 Yes Yes Yes Yes No
Function: Rotates the picture by 270 degree.
Example:
dim l as Picture = LogoMBS(500)
dim p as new PictureMBS(l)
p = p.Rotate270
window1.Backdrop = p.CopyPicture
Notes:
If dest is nil, the PictureFactoryMBS object (local on self or global) is used to create the new picture.
Works with Gray, RGB and CMYK pictures and supports alpha channel.

Feedback, Comments & Corrections

PictureMBS.Rotate270slow(dest as PictureMBS=nil) as PictureMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Large Picture MBS Images Plugin 9.3 Yes Yes Yes Yes No
Function: Rotates the picture by 270 degree.
Example:
dim l as Picture = LogoMBS(500)
dim p as new PictureMBS(l)
p = p.Rotate270slow
window1.Backdrop = p.CopyPicture
Notes:
If dest is nil, the PictureFactoryMBS object (local on self or global) is used to create the new picture.
Works with Gray, RGB and CMYK pictures and supports alpha channel.

Feedback, Comments & Corrections

PictureMBS.Rotate90(dest as PictureMBS=nil) as PictureMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Large Picture MBS Images Plugin 9.1 Yes Yes Yes Yes No
Function: Rotates the picture by 90 degree.
Example:
dim l as Picture = LogoMBS(500)
dim p as new PictureMBS(l)
p = p.Rotate90
window1.Backdrop = p.CopyPicture
Notes:
If dest is nil, the PictureFactoryMBS object (local on self or global) is used to create the new picture.
Works with Gray, RGB and CMYK pictures and supports alpha channel.

Feedback, Comments & Corrections

PictureMBS.Rotate90slow(dest as PictureMBS=nil) as PictureMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Large Picture MBS Images Plugin 9.3 Yes Yes Yes Yes No
Function: Rotates the picture by 90 degree.
Example:
dim l as Picture = LogoMBS(500)
dim p as new PictureMBS(l)
p = p.Rotate90slow
window1.Backdrop = p.CopyPicture
Notes:
If dest is nil, the PictureFactoryMBS object (local on self or global) is used to create the new picture.
Works with Gray, RGB and CMYK pictures and supports alpha channel.

Feedback, Comments & Corrections

PictureMBS.Row(index as Integer) as memoryblock
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Large Picture MBS Images Plugin 9.0 Yes Yes Yes Yes No
Function: A memoryblock with the data of this row.
Example:
// create new image
dim p as new PictureMBS(100,100,PictureMBS.ImageFormatRGB)
// copy row
dim m as MemoryBlock = p.Row(10)
// modify
m.FillBytesMBS(10,100,200)
// copy back
p.row(10)=m
// show in window
window1.Backdrop = p.CopyPicture
Notes:
You can get and set a row with this method in the native format.
If you set the row, use a memoryblock with at least RowSize bytes.
If you query the row, you will get a copy of the row bytes in a new memoryblock.
Returns "" on any error.
May raise OutOfBoundsException for invalid index.
(Read and Write computed property)

Feedback, Comments & Corrections

PictureMBS.RowInFormat(index as Integer, ImageFormat as Integer) as memoryblock
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Large Picture MBS Images Plugin 9.0 Yes Yes Yes Yes No
Function: A memoryblock with the data of this row in the format you request.
Example:
// create new image
dim p as new PictureMBS(100,100,PictureMBS.ImageFormatRGB)
// copy row
dim m as MemoryBlock = p.RowInFormat(10, p.ImageFormatRofRGB)
// modify
m.FillBytesMBS(10,80,200)
// copy back
p.RowInFormat(10, p.ImageFormatRofRGB)=m
// show in window
window1.Backdrop = p.CopyPicture
Notes:
You can get and set a row with this method in the given format.
If you set the row, use a memoryblock with at least Width*PixelSize bytes. PixelSize is the format dependend size in bytes for one pixel.
If you query the row, you will get a copy of the row bytes in a new memoryblock.
Returns nil on any error.
May raise OutOfBoundsException for invalid index.
(Read and Write computed property)

See also:

Feedback, Comments & Corrections

PictureMBS.RowInFormat(index as Integer, ImageFormat as Integer, InvertAlpha as boolean) as memoryblock
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Large Picture MBS Images Plugin 9.4 Yes Yes Yes Yes No
Function: A memoryblock with the data of this row in the format you request.
Example:
// create new image
dim p as new PictureMBS(100,100,PictureMBS.ImageFormatRGB)
// copy row
dim m as MemoryBlock = p.RowInFormat(10, p.ImageFormatRGB, true)
// modify
m.FillBytesMBS(10,80,200)
// copy back
p.RowInFormat(10, p.ImageFormatRGB, true)=m
// show in window
window1.Backdrop = p.CopyPicture
Notes:
You can get and set a row with this method in the given format.
If you set the row, use a memoryblock with at least Width*PixelSize bytes. PixelSize is the format dependend size in bytes for one pixel.
If you query the row, you will get a copy of the row bytes in a new memoryblock.
Returns nil on any error.
May raise OutOfBoundsException for invalid index.
If InvertAlpha is true, the alpha values are inverted by using A=255-A.
(Read and Write computed property)

See also:

Feedback, Comments & Corrections

PictureMBS.RowStringInFormat(index as Integer, ImageFormat as Integer) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Large Picture MBS Images Plugin 9.2 Yes Yes Yes Yes No
Function: The row as a string.
Notes:
You can get and set a row with this method in the native format.
If you set the row, use a memoryblock with at least RowSize bytes.
If you query the row, you will get a copy of the row bytes in a string.
Returns nil on any error.
May raise OutOfBoundsException for invalid index.
(Read and Write computed property)

Feedback, Comments & Corrections

PictureMBS.Scale(source as PictureMBS, temp as PictureMBS, mode as Integer, width as Integer, height as Integer) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Large Picture MBS Images Plugin 8.7 Yes Yes Yes Yes No
Function: Scales the picture to the given size.
Notes:
The final image is stored in the PictureMBS object you call this method on.
On low memory this function can fail or the image may look bad. (e.g. all black)

The size of the temporary picture must have the size of the destination width and the source height. Use ImageFormatScaling when you create the temp image to give it the correct size.

For scaling with the same size as the picture already has, the scaling is still performed.

Returns true on success and false on any error. (e.g. width=0)

Use the constants for the mod:
ScaleTriangletriangle
ScaleBoxbox, nereast neighbor
ScaleLanczos3lanczos 3
ScaleLanczos8lanczos 8
ScaleMitchellmitchell
ScalePoly3poly 3
ScaleCubiccubic

This function is optimized for several image formats:
- Gray to Gray.
- RGB to Gray uses R*0.3+G*0.59+B*0.11.
- RGB to RGB.
- Gray to RGB fill red, green and blue with the same gray value.
If an alpha channel exists in both images, it is copied.

Feedback, Comments & Corrections

PictureMBS.ScaleFast(source as PictureMBS, width as Integer, height as Integer) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Large Picture MBS Images Plugin 8.7 Yes Yes Yes Yes No
Function: Scales the picture to the new size fast.
Notes:
The final image is stored in the PictureMBS object you call this method on.
Returns true on success and false on failure.

This is a low quality alorithm, but it is fast.

This function is optimized for several image formats:
- Gray to Gray.
- RGB to Gray uses R*0.3+G*0.59+B*0.11.
- RGB to RGB.
- Gray to RGB fill red, green and blue with the same gray value.
If an alpha channel exists in both images, it is copied.

Feedback, Comments & Corrections

PictureMBS.ScaleMT(threads as Integer, source as PictureMBS, temp as PictureMBS, mode as Integer, width as Integer, height as Integer) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Large Picture MBS Images Plugin 11.3 Yes Yes Yes Yes No
Function: The multithreaded variant of Scale function.
Notes:
Same as Scale, but with additional multithreading.
Must be called inside a Xojo (Real Studio) thread so time yields to main thread and you can keep the GUI running.
Work is split into several threads for greater speed.

Threads parameter specifies how many threads you want to use:
A negative value disables threading, zero will use one thread for each CPU core and a positive number specifies the thread count.

If one of the pictures used has IsMapping = true, the plugin calls Scale() function.

Feedback, Comments & Corrections

PictureMBS.SolarizeFilter(dest as PictureMBS) as PictureMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Large Picture MBS Images Plugin 9.3 Yes Yes Yes Yes No
Function: Applies the solarize filter to the picture.
Example:
// get some picture
dim l as Picture = LogoMBS(500)
// create new image
dim p as new PictureMBS(l)
// add filter
p = p.SolarizeFilter(nil)
// show in window
window1.Backdrop = p.CopyPicture
Notes:
if dest is nil, the picture factory is used to create a new picture.
On success dest or the new picture is returned.
If dest is not nil, it must match the size of the original picture.

Returns nil on any error.
Works with Gray, RGB and CMYK pictures and supports alpha channel.

Feedback, Comments & Corrections

Previous items Next items

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




Links
MBS Xojo Plugins