Platforms to show: All Mac Windows Linux Cross-Platform

Back to PictureMBS class.

Previous items Next items

PictureMBS.FillRect(x as integer, y as integer, width as integer, height as integer, Value as integer, Alpha as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 18.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Fills the given area of the picture with the given color.

All channels are filled with the given value and alpha channel (if exists) with the alpha value.
The range of value is 0 to 255.
Works with Gray, RGB and CMYK pictures and supports alpha channel.

See also:

PictureMBS.FillRectApply(FillColor as color, alpha as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 12.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Fills the picture with the given color with using alpha.
Example
dim p as new PictureMBS(300, 300, PictureMBS.ImageFormatRGB)

p.FillRectRGB &cFF0000

call p.FillRectApply 0, 0, 50, 100, &c00FF00, 0
call p.FillRectApply 50, 0, 50, 100, &c00FF00, 255*1/5
call p.FillRectApply 100, 0, 50, 100, &c00FF00, 255*2/5
call p.FillRectApply 150, 0, 50, 100, &c00FF00, 255*3/5
call p.FillRectApply 200, 0, 50, 100, &c00FF00, 255*4/5
call p.FillRectApply 250, 0, 50, 100, &c00FF00, 255*5/5

Backdrop = p.CopyPicture

Works with gray and RGB pictures.
The range of value is 0 to 255.
The alpha channel is ignored of the picture.
This function combines the RGB/Gray channels with the new fill color and the alpha value.

See also:

PictureMBS.FillRectApply(red as Integer, green as Integer, blue as Integer, alpha as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 12.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Fills the picture with the given color with using alpha.

Works with gray and RGB pictures.
The range of value is 0 to 255.
The alpha channel is ignored of the picture.
This function combines the RGB/Gray channels with the new fill color and the alpha value.

See also:

PictureMBS.FillRectApply(x as Integer, y as Integer, width as Integer, height as Integer, FillColor as color, alpha as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 12.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Fills the picture with the given color with using alpha.

Works with gray and RGB pictures.
The range of value is 0 to 255.
The alpha channel is ignored of the picture.
This function combines the RGB/Gray channels with the new fill color and the alpha value.

See also:

PictureMBS.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

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 12.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Fills the picture with the given color with using alpha.

Works with gray and RGB pictures.
The range of value is 0 to 255.
The alpha channel is ignored of the picture.
This function combines the RGB/Gray channels with the new fill color and the alpha value.

See also:

PictureMBS.FillRectRandom

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 10.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Fills the pixels with random values.
Example
dim p as new PictureMBS(1000,1000, PictureMBS.imageFormatRGB)

p.FillRectRandom

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

See also:

PictureMBS.FillRectRandom(x as Integer, y as Integer, width as Integer, height as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 10.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Fills the pixels with random values.
Example
dim p as new PictureMBS(1000,1000, PictureMBS.imageFormatRGB)
p.FillRectRandom(0,0,100,100)
Backdrop = p.CopyPicture

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

See also:

PictureMBS.GainFilter(dest as PictureMBS, gain as Double, bias as Double) as PictureMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Applies the gain filter to the picture.

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.

Some examples using this method:

PictureMBS.GammaFilter(dest as PictureMBS, gamma as Double) as PictureMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Changes the gamma value of the picture.

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.

See also:

Some examples using this method:

PictureMBS.GammaFilter(dest as PictureMBS, gamma as Double, alphaGamma as Double) as PictureMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Changes the gamma value of the picture.

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.

If the picture has no alpha channel, the alpha parameter is ignored.

Returns nil on any error.

See also:

PictureMBS.GammaFilter(dest as PictureMBS, redGamma as Double, greenGamma as Double, blueGamma as Double) as PictureMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Changes the gamma value of the picture.

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.

For grayscale pictures the gray color is calculated from red, green and blue value.

Returns nil on any error.

See also:

PictureMBS.GammaFilter(dest as PictureMBS, redGamma as Double, greenGamma as Double, blueGamma as Double, alphaGamma as Double) as PictureMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Changes the gamma value of the picture.

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.

For grayscale pictures the gray color is calculated from red, green and blue value.
If the picture has no alpha channel, the alpha parameter is ignored.

Returns nil on any error.

See also:

PictureMBS.GrayChannel as PictureMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 8.7 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The gray channel as a new PictureMBS object.
Example
dim p as new PictureMBS(100,100,PictureMBS.ImageFormatRGB)
dim r as PictureMBS = p.GrayChannel
r.fillrect(100) // fill only gray channel

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.

PictureMBS.GreenChannel as PictureMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 8.7 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The green channel as a new PictureMBS object.
Example
dim p as new PictureMBS(100,100,PictureMBS.ImageFormatRGB)
dim r as PictureMBS = p.GreenChannel
r.fillrect(100) // fill only green channel

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.

PictureMBS.HMirror

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 8.7 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
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

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

Some examples using this method:

PictureMBS.Invert

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 8.7 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Inverts the image data.

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

See also:

PictureMBS.Invert(x as Integer, y as Integer, w as Integer, h as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 8.7 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Inverts the image data in the given area.

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

See also:

PictureMBS.MagentaChannel as PictureMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 11.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The magenta channel of a CMYK picture as a new PictureMBS object.

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.

PictureMBS.MapInRows(FirstRow as Integer, LastRow as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 17.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Maps in given row range.

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.

PictureMBS.MirroredView as PictureMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 10.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a new PictureMBS object which draws into the existing on, but has all rows vertically mirrored.

So if the new picture draws into the first row, the change will be in the last row of the original picture.

Some examples using this method:

PictureMBS.Multiply

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 18.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Multiplies alpha channel of whole picture.

Pictures with alpha channel must be multiplied, while pictures with mask have the alpha unmultiplied and inverse in the mask.

See also:

PictureMBS.Multiply(x as integer, y as integer, width as integer, height as integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 18.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Multiplies alpha channel of a rectangle of the picture.

Pictures with alpha channel must be multiplied, while pictures with mask have the alpha unmultiplied and inverse in the mask.

See also:

PictureMBS.NeonFilter(dest as PictureMBS) as PictureMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 9.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
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

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.

PictureMBS.OilFilter(dest as PictureMBS, levels as Integer, range as Integer) as PictureMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 9.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
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

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.

PictureMBS.RawRow(index as Integer) as memoryblock

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 9.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
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

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!

Some examples using this method:

PictureMBS.RawRowPtr(index as Integer) as Ptr

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 17.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns a Ptr pointing to the data of this row.

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!

PictureMBS.RedChannel as PictureMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 8.7 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
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

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.

PictureMBS.RGBChannels as PictureMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
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

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.

PictureMBS.RGBToGray(mode as Integer = 0) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 15.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Turns picture into grayscale.

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.

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 iOS Targets
method Large Picture MBS Images Plugin 9.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
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

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.

PictureMBS.Rotate180

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 9.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
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

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:

Previous items Next items

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


The biggest plugin in space...