Platforms to show: All Mac Windows Linux Cross-Platform
Picture.ReplaceRedChannelMBS(RedChannel as picture) as picture
Function:
Returns a copy of the picture with the red channel replaced with the red channel of the given picture.
Notes: Returns nil on low memory.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Graphics & Pictures | MBS Picture Plugin | 9.4 | Yes | Yes | Yes | Yes | No |
Notes: Returns nil on low memory.
Picture.RotateImageAndMaskMBS(angle as Double, cut as boolean = False) as picture
Function:
Rotates the picture by angle° counter clockwise.
Notes:
Internally uses RotateMBS.
Works with masked and alpha channel pictures, but is faster with masked pictures.
Returns nil on any error.
if cut is true, the image is cut to the original size.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Graphics & Pictures | MBS Picture Plugin | 13.4 | Yes | Yes | Yes | Yes | No |
Notes:
Internally uses RotateMBS.
Works with masked and alpha channel pictures, but is faster with masked pictures.
Returns nil on any error.
if cut is true, the image is cut to the original size.
Picture.ScaleImageAndMaskMBS(width as Integer, height as Integer, AntiAlias as boolean=false, YieldTicks as Integer=0) as picture
Function:
Scales the picture to the new size including mask (in case one exists).
Notes:
This is a self made algorithm which produces nice pictures on all platforms.
It is slower than QuickDraw on Mac OS, but nicer than drawpicture on Windows.
Returns nil on low memory or invalid width and height values.
AntiAlias is set to false if width<=self.width or height<=self.height.
If YieldTicks is 0, no time is given to other threads in your application. If it is a value > 0, this time is waited before a thread switch is done. Setting it to 1 will give away control to another thread after 1/60th of a second. We recommend a value of 3 to 5 for a good reponsibility of your application.
Version 19.4 or newer of our plugin includes scaling for pictures with alpha channel.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Graphics & Pictures | MBS Picture Plugin | 7.0 | Yes | Yes | Yes | Yes | No |
Notes:
This is a self made algorithm which produces nice pictures on all platforms.
It is slower than QuickDraw on Mac OS, but nicer than drawpicture on Windows.
Returns nil on low memory or invalid width and height values.
AntiAlias is set to false if width<=self.width or height<=self.height.
If YieldTicks is 0, no time is given to other threads in your application. If it is a value > 0, this time is waited before a thread switch is done. Setting it to 1 will give away control to another thread after 1/60th of a second. We recommend a value of 3 to 5 for a good reponsibility of your application.
Version 19.4 or newer of our plugin includes scaling for pictures with alpha channel.
Some examples using this method:
Picture.ScaleMBS(width as Integer, height as Integer, AntiAlias as boolean=false, YieldTicks as Integer=0) as picture
Function:
Scales the picture to the new size.
Example:
Notes:
This is a self made algorithm which produces nice pictures on all platforms.
It is slower than QuickDraw on Mac OS, but nicer than drawpicture on Windows.
Returns nil on low memory or invalid width and height values.
AntiAlias is set to false if width<=self.width or height<=self.height.
If YieldTicks is 0, no time is given to other threads in your application. If it is a value > 0, this time is waited before a thread switch is done. Setting it to 1 will give away control to another thread after 1/60th of a second. We recommend a value of 3 to 5 for a good reponsibility of your application.
Scaling down does not use antialias. If you need full antialias, please use ScalingMBS function.
If input and output size is equal, you get your picture back unchanged.
This function does not handle masks. Please use pictures with mask and scale image and mask separately.
Version 19.4 or newer of our plugin includes scaling for pictures with alpha channel.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Graphics & Pictures | MBS Picture Plugin | 5.1 | Yes | Yes | Yes | Yes | No |
Example:
dim pic as new Picture(100,100,32)
pic.Graphics.ForeColor=&cFF0000
pic.Graphics.FillOval 0,0,100,100
dim scaledPic as picture = pic.ScaleMBS(200,200)
// show scaledPic
window1.backdrop = scaledPic
This is a self made algorithm which produces nice pictures on all platforms.
It is slower than QuickDraw on Mac OS, but nicer than drawpicture on Windows.
Returns nil on low memory or invalid width and height values.
AntiAlias is set to false if width<=self.width or height<=self.height.
If YieldTicks is 0, no time is given to other threads in your application. If it is a value > 0, this time is waited before a thread switch is done. Setting it to 1 will give away control to another thread after 1/60th of a second. We recommend a value of 3 to 5 for a good reponsibility of your application.
Scaling down does not use antialias. If you need full antialias, please use ScalingMBS function.
If input and output size is equal, you get your picture back unchanged.
This function does not handle masks. Please use pictures with mask and scale image and mask separately.
Version 19.4 or newer of our plugin includes scaling for pictures with alpha channel.
Some examples using this method:
Picture.ScalingMBS(mode as Integer, width as Integer, height as Integer, yield as Integer = 0) as picture
Function:
Scales the picture to the given size.
Example:
Notes:
On low memory this function can return nil or the image may look bad. (e.g. all black)
The memory used for the temporary storage is original height * new width * 12 bytes plus some extra.
For scaling with the same size as the picture already has, the scaling is still performed.
Returns nil ony error. (e.g. destwidth=0)
Modes:
This function does not handle mask. Please use pictures with mask and scale image and mask separately.
Version 19.4 or newer of our plugin includes scaling for pictures with alpha channel.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Graphics & Pictures | MBS Picture Plugin | 8.0 | Yes | Yes | Yes | Yes | No |
Example:
dim p as Picture
p=LogoMBS(1000)
p=p.ScalingMBS(2, 4000, 4000)
backdrop=p
On low memory this function can return nil or the image may look bad. (e.g. all black)
The memory used for the temporary storage is original height * new width * 12 bytes plus some extra.
For scaling with the same size as the picture already has, the scaling is still performed.
Returns nil ony error. (e.g. destwidth=0)
Modes:
1 | triangle |
2 | box, nereast neighbor |
3 | lanczos 3 |
4 | lanczos 8 |
5 | mitchell |
6 | poly 3 |
7 | cubic |
This function does not handle mask. Please use pictures with mask and scale image and mask separately.
Version 19.4 or newer of our plugin includes scaling for pictures with alpha channel.
Picture.ScrollHorizontalMBS(delta as Integer, wrap as boolean, scrollmask as boolean) as boolean
Function:
Scrolls the image data horizontally.
Example:
Notes:
Returns true on success and false on failure.
Works only on Mac OS and Windows with 32bit bitmap images.
scrollmask defines whether a mask (if one exists) is also scrolled.
Wrap will define whether the image will wrap on the edges. If wrap is enabled on Mac, the whole thing speeds up.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Graphics & Pictures | MBS Picture Plugin | 6.5 | Yes | Yes | No | Yes | No |
Example:
dim p as Picture
p=LogoMBS(500) // any bitmap image
if p.ScrollHorizontalMBS(100,true,false) then
Title="ok"
end if
Backdrop=p
Returns true on success and false on failure.
Works only on Mac OS and Windows with 32bit bitmap images.
scrollmask defines whether a mask (if one exists) is also scrolled.
Wrap will define whether the image will wrap on the edges. If wrap is enabled on Mac, the whole thing speeds up.
Picture.ScrollMBS(deltaX as Integer, deltaY as Integer, wrap as boolean, scrollmask as boolean) as boolean
Function:
Combines calls to ScrollHorizontalMBS and ScrollVerticalMBS.
Notes:
Returns true on success and false on failure.
Works only on Mac OS and Windows with 32bit bitmap images.
scrollmask defines whether a mask (if one exists) is also scrolled.
Wrap will define whether the image will wrap on the edges. If wrap is enabled on Mac, the whole thing speeds up.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Graphics & Pictures | MBS Picture Plugin | 6.5 | Yes | Yes | No | Yes | No |
Notes:
Returns true on success and false on failure.
Works only on Mac OS and Windows with 32bit bitmap images.
scrollmask defines whether a mask (if one exists) is also scrolled.
Wrap will define whether the image will wrap on the edges. If wrap is enabled on Mac, the whole thing speeds up.
Some examples using this method:
Picture.ScrollVerticalMBS(delta as Integer, wrap as boolean, scrollmask as boolean) as boolean
Function:
Scrolls the image data vertically.
Example:
Notes:
Returns true on success and false on failure.
Works only on Mac OS and Windows with 32bit bitmap images.
scrollmask defines whether a mask (if one exists) is also scrolled.
Wrap will define whether the image will wrap on the edges. If wrap is enabled on Mac, the whole thing speeds up.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Graphics & Pictures | MBS Picture Plugin | 6.5 | Yes | Yes | No | Yes | No |
Example:
dim p as Picture
p=LogoMBS(500) // any bitmap image
if p.ScrollVerticalMBS(100,true,false) then
Title="ok"
end if
Backdrop=p
Returns true on success and false on failure.
Works only on Mac OS and Windows with 32bit bitmap images.
scrollmask defines whether a mask (if one exists) is also scrolled.
Wrap will define whether the image will wrap on the edges. If wrap is enabled on Mac, the whole thing speeds up.
Picture.SetSteganographyMBS(flags as Integer, data as Memoryblock) as boolean
Function:
Adds steganography to an existing picture.
Example:
Notes:
Flags can be a combination of red (&h100), green (&h010) and blue (&h001).
Returns true on success or false on failure.
If memoryblock provided is nil, this function fails.
If you like to store data, please encrypt them and include some way that you find your data again, detect length of data, verify it's okay via checksum and than decrypt your data.
Please store image in a loss less format like PNG.
Function does not handle mask or alpha channel.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Graphics & Pictures | MBS Picture Plugin | 14.2 | Yes | Yes | Yes | Yes | No |
Example:
dim p as Picture = LogoMBS(500)
// this example uses chr(0) as end marker
dim s as string = "Hello World. This is just a test." + chr(0)
if p.SetSteganographyMBS(1, s) then
dim data as MemoryBlock = p.SteganographyMBS(1)
dim d as string = data.CString(0)
Backdrop = p
Break
end if
Flags can be a combination of red (&h100), green (&h010) and blue (&h001).
Returns true on success or false on failure.
If memoryblock provided is nil, this function fails.
If you like to store data, please encrypt them and include some way that you find your data again, detect length of data, verify it's okay via checksum and than decrypt your data.
Please store image in a loss less format like PNG.
Function does not handle mask or alpha channel.
Picture.SetSteganographyPictureMBS(flags as Integer, data as Picture) as boolean
Function:
Adds steganography to an existing picture.
Example:
Notes:
Flags can be a combination of red (&h100), green (&h010) and blue (&h001).
Returns true on success or false on failure.
Function does not handle mask or alpha channel.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Graphics & Pictures | MBS Picture Plugin | 16.2 | Yes | Yes | Yes | Yes | No |
Example:
const AllChannels = &h111
dim p as new Picture(500, 500, 32)
dim l as Picture = LogoMBS(500)
dim w as new window1
w.Title = "Logo"
w.Backdrop = l
// adds picture. You will normally not see the modification
if p.SetSteganographyPictureMBS(AllChannels, l) then
w = new window1
w.Title = "Logo hidden in white picture"
w.Backdrop = p
// as we store in lowest bit, this picture will look strange
dim y as Picture = p.SteganographyPictureMBS(AllChannels)
w = new window1
w.Title = "Logo extracted"
w.Backdrop = y
end if
Flags can be a combination of red (&h100), green (&h010) and blue (&h001).
Returns true on success or false on failure.
Function does not handle mask or alpha channel.
Picture.SobelChannelsMBS(Red as boolean, Green as Boolean, Blue as boolean, direction1 as Integer = 1, direction2 as Integer = 3, swap as boolean = false) as picture
Function:
Calculates the sobel operator.
Example:
Notes:
Useful for edge detection.
See also SobelMBS function which takes similar operators.
You can set Red/Blue/Green parameters to define which channel is modified and which channel is just copied.
Pictures look quite funny. The channel who got the edge detection has bigger areas black or white so other colors in other channels have much more visible effect.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Graphics & Pictures | MBS Picture Plugin | 11.1 | Yes | Yes | Yes | Yes | No |
Example:
dim m as Picture = LogoMBS(500)
// only green
Backdrop = m.SobelChannelsMBS(false, true, false)
Useful for edge detection.
See also SobelMBS function which takes similar operators.
You can set Red/Blue/Green parameters to define which channel is modified and which channel is just copied.
Pictures look quite funny. The channel who got the edge detection has bigger areas black or white so other colors in other channels have much more visible effect.
Some examples using this method:
Picture.SobelMBS(direction1 as Integer = 1, direction2 as Integer = 3, swap as boolean = false, gray as boolean = true) as picture
Function:
Calculates the sobel operator.
Example:
Notes:
Useful for edge detection.
direction1: The direction for first matrix.
direction2: The direction for first matrix.
swap: If false, you get white on black. If true you get black on white.
gray: whether to output gray image instead of RGB image.
Possible Matrix values:
-1: negative identity:
0: identity
1: west
2: east
3: north
4: south
5: south east
6: north west
7: north east
8: south west
You can add 10 to the 8 direction matrixes to get more weight.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Graphics & Pictures | MBS Picture Plugin | 11.1 | Yes | Yes | Yes | Yes | No |
Example:
dim m as Picture = LogoMBS(500)
Backdrop = m.SobelMBS
Useful for edge detection.
direction1: The direction for first matrix.
direction2: The direction for first matrix.
swap: If false, you get white on black. If true you get black on white.
gray: whether to output gray image instead of RGB image.
Possible Matrix values:
-1: negative identity:
0: identity
1: west
2: east
3: north
4: south
5: south east
6: north west
7: north east
8: south west
You can add 10 to the 8 direction matrixes to get more weight.
Some examples using this method:
Picture.SteganographyMBS(flags as Integer) as Memoryblock
Function:
Queries steganography information inside the picture.
Example:
Notes:
Flags can be a combination of red (&h100), green (&h010) and blue (&h001).
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Graphics & Pictures | MBS Picture Plugin | 14.2 | Yes | Yes | Yes | Yes | No |
Example:
dim p as Picture = LogoMBS(500)
dim s as string = "Hello World. This is just a test." + chr(0)
if p.SetSteganographyMBS(1, s) then
dim data as MemoryBlock = p.SteganographyMBS(1)
dim d as string = data.CString(0)
Backdrop = p
Break
end if
Picture.SteganographyPictureMBS(flags as Integer) as Picture
Function:
Queries steganography information inside the picture.
Example:
Notes:
Flags can be a combination of red (&h100), green (&h010) and blue (&h001).
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Graphics & Pictures | MBS Picture Plugin | 16.2 | Yes | Yes | Yes | Yes | No |
Example:
const AllChannels = &h111
dim p as new Picture(500, 500, 32)
dim w as new window1
w.Title = "white"
w.Backdrop = p
dim l as Picture = LogoMBS(500)
w = new window1
w.Title = "Logo"
w.Backdrop = l
// adds picture. You will normally not see the modification
dim x as Picture = p.AddSteganographyPictureMBS(AllChannels, l)
w = new window1
w.Title = "Logo hidden in white picture"
w.Backdrop = x
// as we store in lowest bit, this picture will look strange
dim y as Picture = x.SteganographyPictureMBS(AllChannels)
w = new window1
w.Title = "Logo extracted"
w.Backdrop = y
Some examples using this method:
Picture.ThreadedTransformMBS(Threaded as Integer, Map() as color, dest as picture = nil) as picture
Function:
Performs a transformation to the picture.
Example:
Notes:
Threaded 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.
For each color in the source picture the red, blue and green values are used as index (blue+green*256+blue*65536) in the arrays to get the new color value.
The arrays should have 2^24 entries.
You can pass destination picture. If dest is not nil and size matches, the plugin reuses the picture object which increases performance as no new picture is created.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Graphics & Pictures | MBS Picture Plugin | 10.0 | Yes | Yes | Yes | Yes | No |
Example:
dim p as Picture = LogoMBS(500)
dim map(-1) as color
for r as Integer = 0 to 255
for g as Integer = 0 to 255
for b as Integer = 0 to 255
// index is r*65536+g*256+b
// we swap colors: r gives g, g gives b, b gives r
map.Append rgb(g,b,r)
next
next
next
Backdrop=p.ThreadedTransformMBS(0, map)
Threaded 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.
For each color in the source picture the red, blue and green values are used as index (blue+green*256+blue*65536) in the arrays to get the new color value.
The arrays should have 2^24 entries.
You can pass destination picture. If dest is not nil and size matches, the plugin reuses the picture object which increases performance as no new picture is created.
See also:
- ThreadedTransformMBS(Threaded as Integer, Map() as Integer, dest as picture = nil) as picture
- ThreadedTransformMBS(Threaded as Integer, RedMap as memoryblock, GreenMap as memoryblock, BlueMap as memoryblock, dest as picture = nil) as picture
- ThreadedTransformMBS(Threaded as Integer, RedMap() as Integer, GreenMap() as Integer, BlueMap() as Integer, dest as picture = nil) as picture
Some examples using this method:
Picture.ThreadedTransformMBS(Threaded as Integer, Map() as Integer, dest as picture = nil) as picture
Function:
Performs a transformation to the picture.
Example:
Notes:
Threaded 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.
For each color in the source picture the red, blue and green values are used as index (blue+green*256+blue*65536) in the arrays to get the new color value.
The arrays should have 2^24 entries.
You can pass destination picture. If dest is not nil and size matches, the plugin reuses the picture object which increases performance as no new picture is created.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Graphics & Pictures | MBS Picture Plugin | 10.0 | Yes | Yes | Yes | Yes | No |
Example:
dim p as Picture = LogoMBS(500)
dim map(-1) as Integer
for r as Integer = 0 to 255
for g as Integer = 0 to 255
for b as Integer = 0 to 255
// index is r*65536+g*256+b
// we swap colors: r gives g, g gives b, b gives r
map.Append g*65536+b*256+r
next
next
next
Backdrop=p.ThreadedTransformMBS(0, map)
Threaded 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.
For each color in the source picture the red, blue and green values are used as index (blue+green*256+blue*65536) in the arrays to get the new color value.
The arrays should have 2^24 entries.
You can pass destination picture. If dest is not nil and size matches, the plugin reuses the picture object which increases performance as no new picture is created.
See also:
- ThreadedTransformMBS(Threaded as Integer, Map() as color, dest as picture = nil) as picture
- ThreadedTransformMBS(Threaded as Integer, RedMap as memoryblock, GreenMap as memoryblock, BlueMap as memoryblock, dest as picture = nil) as picture
- ThreadedTransformMBS(Threaded as Integer, RedMap() as Integer, GreenMap() as Integer, BlueMap() as Integer, dest as picture = nil) as picture
Some examples using this method:
Picture.ThreadedTransformMBS(Threaded as Integer, RedMap as memoryblock, GreenMap as memoryblock, BlueMap as memoryblock, dest as picture = nil) as picture
Function:
Performs a transformation to the picture.
Example:
Notes:
Threaded 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.
For each color in the source picture the red, blue and green values are used as index in the memoryblocks to get the new color value.
The memoryblocks must have a size of 256 Bytes.
You can pass destination picture. If dest is not nil and size matches, the plugin reuses the picture object which increases performance as no new picture is created.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Graphics & Pictures | MBS Picture Plugin | 10.0 | Yes | Yes | Yes | Yes | No |
Example:
dim p as Picture = LogoMBS(500)
dim red as MemoryBlock = NewMemoryBlock(256)
dim green as MemoryBlock = NewMemoryBlock(256)
dim blue as MemoryBlock = NewMemoryBlock(256)
for i as Integer=0 to 255
red.Byte(i)=i/2
green.Byte(i)=i/2
blue.Byte(i)=i/2
next
Backdrop=p.ThreadedTransformMBS(0, red, green, blue)
Threaded 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.
For each color in the source picture the red, blue and green values are used as index in the memoryblocks to get the new color value.
The memoryblocks must have a size of 256 Bytes.
You can pass destination picture. If dest is not nil and size matches, the plugin reuses the picture object which increases performance as no new picture is created.
See also:
- ThreadedTransformMBS(Threaded as Integer, Map() as color, dest as picture = nil) as picture
- ThreadedTransformMBS(Threaded as Integer, Map() as Integer, dest as picture = nil) as picture
- ThreadedTransformMBS(Threaded as Integer, RedMap() as Integer, GreenMap() as Integer, BlueMap() as Integer, dest as picture = nil) as picture
Some examples using this method:
Picture.ThreadedTransformMBS(Threaded as Integer, RedMap() as Integer, GreenMap() as Integer, BlueMap() as Integer, dest as picture = nil) as picture
Function:
Performs a transformation to the picture.
Example:
Notes:
Threaded 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.
For each color in the source picture the red, blue and green values are used as index in the arrays to get the new color value.
The arrays should have 256 entries.
You can pass destination picture. If dest is not nil and size matches, the plugin reuses the picture object which increases performance as no new picture is created.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Graphics & Pictures | MBS Picture Plugin | 10.0 | Yes | Yes | Yes | Yes | No |
Example:
dim p as Picture = LogoMBS(500)
dim red(-1) as Integer
dim green(-1) as Integer
dim blue(-1) as Integer
for i as Integer=0 to 255
red.Append i/2
green.Append i/2
blue.Append i/2
next
Backdrop=p.ThreadedTransformMBS(0, red, green, blue)
Threaded 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.
For each color in the source picture the red, blue and green values are used as index in the arrays to get the new color value.
The arrays should have 256 entries.
You can pass destination picture. If dest is not nil and size matches, the plugin reuses the picture object which increases performance as no new picture is created.
See also:
- ThreadedTransformMBS(Threaded as Integer, Map() as color, dest as picture = nil) as picture
- ThreadedTransformMBS(Threaded as Integer, Map() as Integer, dest as picture = nil) as picture
- ThreadedTransformMBS(Threaded as Integer, RedMap as memoryblock, GreenMap as memoryblock, BlueMap as memoryblock, dest as picture = nil) as picture
Some examples using this method:
Picture.ThresholdMBS(Threshold as integer) as picture
Function:
Creates black and white picture.
Notes:
With threshold value you define threshold in range from 0 to 255.
Normally you use 127 for turning picture to black & white.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Graphics & Pictures | MBS Picture Plugin | 17.5 | Yes | Yes | Yes | Yes | No |
Notes:
With threshold value you define threshold in range from 0 to 255.
Normally you use 127 for turning picture to black & white.
Picture.TransformColorsMBS(red as memoryblock, blue as memoryblock, green as memoryblock, dest as picture = nil) as picture
Function:
Applies a transform table to the pixels.
Notes:
Red, blue and green are 256 byte big memoryblocks with one byte for each value.
In RB the function does this:
color=rgb(red.byte[color.red], green.byte[color.green], blue.byte[color.blue])
If you pass a destination picture and it has right size, the plugin will recycle that instead of creating a new one to increase performance.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Graphics & Pictures | MBS Picture Plugin | 4.3 | Yes | Yes | Yes | Yes | No |
Notes:
Red, blue and green are 256 byte big memoryblocks with one byte for each value.
In RB the function does this:
color=rgb(red.byte[color.red], green.byte[color.green], blue.byte[color.blue])
If you pass a destination picture and it has right size, the plugin will recycle that instead of creating a new one to increase performance.
Some examples using this method:
Picture.TrimMBS(left as Integer, top as Integer, width as Integer, height as Integer) as picture
Function:
Trims the picture to the given rectangle.
Example:
Notes:
This method does not handle the mask.
So p.Trim(0,0,p.width,p.height) will give you a copy of the image pixels without mask.
left and top are zero based.
Use TrimWithMaskMBS if you need the mask to be trimmed.
Returns nil on low memory or bad parameters.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Graphics & Pictures | MBS Picture Plugin | 8.0 | Yes | Yes | Yes | Yes | No |
Example:
dim p as Picture = LogoMBS(500)
Backdrop = p.TrimMBS(100,100,300,300)
This method does not handle the mask.
So p.Trim(0,0,p.width,p.height) will give you a copy of the image pixels without mask.
left and top are zero based.
Use TrimWithMaskMBS if you need the mask to be trimmed.
Returns nil on low memory or bad parameters.
Picture.TrimWithMaskMBS(left as Integer, top as Integer, width as Integer, height as Integer) as picture
Function:
Trims the picture to the given rectangle.
Example:
Notes:
left and top are zero based.
Returns nil on low memory or bad parameters.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Graphics & Pictures | MBS Picture Plugin | 8.0 | Yes | Yes | Yes | Yes | No |
Example:
dim p as picture
dim someimage as Picture = LogoMBS(100)
p=someimage.TrimWithMaskMBS(100,200,300,400)
left and top are zero based.
Returns nil on low memory or bad parameters.
Picture.VMirrorMBS as picture
Function:
Mirrors the picture vertically.
Example:
Notes:
This method returns a copy of the picture mirrored.
Returns nil on low memory.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Graphics & Pictures | MBS Picture Plugin | Yes | Yes | Yes | Yes | No |
Example:
canvas1.backdrop=pic.VMirrorMBS
This method returns a copy of the picture mirrored.
Returns nil on low memory.
Some examples using this method:
Picture.VMirrorPictureMBS as boolean
Function:
Mirrors the picture vertically.
Example:
Notes:
This methods mirrors the picture data itself. Returns true on success and false on failure. Only bitmap pictures can be mirrored this way.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | Graphics & Pictures | MBS Picture Plugin | 7.8 | Yes | Yes | Yes | Yes | No |
Example:
if pic.VMirrorPictureMBS then // mirror picture
canvas1.backdrop=pic
else
canvas1.backdrop=pic.VMirrorMBS // mirror a copy
end if
Some examples using this method:
The items on this page are in the following plugins: MBS Picture Plugin.

Links
MBS Xojo Chart Plugins