Xojo Developer Conference
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
 Type Topic Plugin Version macOS Windows Linux Console & Web iOS global method Graphics & Pictures MBS Picture Plugin 8.7 Yes Yes No Yes No
Function: Blends two pictures.
Example:
```dim a,b,c as picturea=newpicture(100,100,32)b=newpicture(100,100,32)' ... draw something in a and bc=newpicture(100,100,32)call BlendPicturesMBS(c, a,0.5,b,0.5, 0, 0, 100, 100)
```
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.

Some examples using this method:

Feedback, Comments & Corrections

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
 Type Topic Plugin Version macOS Windows Linux Console & Web iOS global method Graphics & Pictures MBS Picture Plugin 8.7 Yes Yes No Yes No
Function: Blends two pictures.
Example:
```dim a,b,c,m as picturea=newpicture(100,100,32)b=newpicture(100,100,32)m=newpicture(100,100,32)' ... draw something in a and bcall BlendPicturesWithMaskMBS(c,a,b,m,0,0,a.width,a.height)
```
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.

Some examples using this method:

Feedback, Comments & Corrections

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
 Type Topic Plugin Version macOS Windows Linux Console & Web iOS global method Graphics & Pictures MBS Picture Plugin 8.7 Yes Yes No Yes No
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.

Some examples using this method:

Feedback, Comments & Corrections

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
 Type Topic Plugin Version macOS Windows Linux Console & Web iOS global method Graphics & Pictures MBS Picture Plugin 8.7 Yes Yes No Yes No
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.

Some examples using this method:

Feedback, Comments & Corrections

DiffPicturesMBS(source as picture, dest as picture, square as boolean) as picture
 Type Topic Plugin Version macOS Windows Linux Console & Web iOS global method Graphics & Pictures MBS Picture Plugin 11.1 Yes Yes Yes Yes No
Function: Calculates the difference between two pictures.
Example:
```// our test Picturedim p as Picture = LogoMBS(500)// compress with JPEG and 10%dim d as string = PictureToJPEGStringMBS(p, 10)// decompressdim q as Picture = JPEGStringToPictureMBS(d, true)// compare themwindow1.Backdrop = DiffPicturesMBS(p, q, true)
```
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.