Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.
Platforms to show: All Mac Windows Linux Cross-Platform
BlendPicturesMBS(result as picture, source as picture, sourcepercent as Double, dest as picture, destpercent as Double, x as Integer, y as Integer, width as Integer, height as Integer) as boolean
Function:
Blends two pictures.
Example:
Notes:
Percent is in range from 0 to 1. Values out of this range may work, but you get strange results.
Reason for returning false:
- One of the pictures used is nil.
- The result picture must be a 24 bit or a 32 bit picture.
- The two parameter pictures have not the same size as the others.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
global method | Graphics & Pictures | MBS Picture Plugin | 8.7 | Yes | Yes | No | Yes | No |
Example:
dim a,b,c as picture
a=newpicture(100,100,32)
b=newpicture(100,100,32)
' ... draw something in a and b
c=newpicture(100,100,32)
call BlendPicturesMBS(c, a,0.5,b,0.5, 0, 0, 100, 100)
Percent is in range from 0 to 1. Values out of this range may work, but you get strange results.
Reason for returning false:
- One of the pictures used is nil.
- The result picture must be a 24 bit or a 32 bit picture.
- The two parameter pictures have not the same size as the others.
Some examples using this method:
BlendPicturesWithMaskMBS(result as picture, source as picture, dest as picture, mask as picture, x as Integer, y as Integer, width as Integer, height as Integer) as boolean
Function:
Blends two pictures.
Example:
Notes:
The mask defines how much from one picture is used.
Reason for returning false:
- One of the pictures used is nil.
- The result picture must be a 24 bit or a 32 bit picture.
- The three parameter pictures have not the same size as the others.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
global method | Graphics & Pictures | MBS Picture Plugin | 8.7 | Yes | Yes | No | Yes | No |
Example:
dim a,b,c,m as picture
a=newpicture(100,100,32)
b=newpicture(100,100,32)
m=newpicture(100,100,32)
' ... draw something in a and b
call BlendPicturesWithMaskMBS(c,a,b,m,0,0,a.width,a.height)
The mask defines how much from one picture is used.
Reason for returning false:
- One of the pictures used is nil.
- The result picture must be a 24 bit or a 32 bit picture.
- The three parameter pictures have not the same size as the others.
Some examples using this method:
BlendPicturesWithMaskWithBackgroundMBS(SourceImage As Picture, DestImage As Picture, Mask As Picture, Result As Picture, X as Integer, Y as Integer, Width as Integer, Height as Integer) as boolean
Function:
Blends a picture with another picture.
Notes:
If DestImage is nil, white is used for the background.
If no mask is specified, a full black mask is used.
Result must be valid picture of right size.
Result must be a 24bit or 32bit picture.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
global method | Graphics & Pictures | MBS Picture Plugin | 8.7 | Yes | Yes | No | Yes | No |
Notes:
If DestImage is nil, white is used for the background.
If no mask is specified, a full black mask is used.
Result must be valid picture of right size.
Result must be a 24bit or 32bit picture.
See also:
Some examples using this method:
BlendPicturesWithMaskWithBackgroundMBS(SourceImage As Picture, DestImage As Picture, Mask As Picture, Result As Picture, X as Integer, Y as Integer, Width as Integer, Height as Integer, BackgroundColour As Color) as boolean
Function:
Blends a picture with another picture.
Notes:
If DestImage is nil, BackgroundColour is used for the background.
If no mask is specified, a full black mask is used.
Result must be valid picture of right size.
Result must be a 24bit or 32bit picture.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
global method | Graphics & Pictures | MBS Picture Plugin | 8.7 | Yes | Yes | No | Yes | No |
Notes:
If DestImage is nil, BackgroundColour is used for the background.
If no mask is specified, a full black mask is used.
Result must be valid picture of right size.
Result must be a 24bit or 32bit picture.
See also:
Some examples using this method:
DiffPicturesMBS(source as picture, dest as picture, square as boolean) as picture
Function:
Calculates the difference between two pictures.
Example:
Notes:
Source and dest pictures must have same size. If square, the error is squared, so you see it much better.
Returns nil in case not enough memory is available or pictures do not have same size or are nil.
If both pictures are equal, all pixels in the returned picture are black.
See also Picture.isBlackMBS, and Picture.CompareMBS.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
global method | Graphics & Pictures | MBS Picture Plugin | 11.1 | Yes | Yes | Yes | Yes | No |
Example:
// our test Picture
dim p as Picture = LogoMBS(500)
// compress with JPEG and 10%
dim d as string = PictureToJPEGStringMBS(p, 10)
// decompress
dim q as Picture = JPEGStringToPictureMBS(d, true)
// compare them
window1.Backdrop = DiffPicturesMBS(p, q, true)
Source and dest pictures must have same size. If square, the error is squared, so you see it much better.
Returns nil in case not enough memory is available or pictures do not have same size or are nil.
If both pictures are equal, all pixels in the returned picture are black.
See also Picture.isBlackMBS, and Picture.CompareMBS.
Some examples using this method:
The items on this page are in the following plugins: MBS Picture Plugin.
Links
MBS Xojo Plugins