Platforms to show: All Mac Windows Linux Cross-Platform

Back to Picture class.

Picture.CombineMBS(Image As Picture, Mask As Picture, DestX as Integer, DestY as Integer, SourceX as Integer, SourceY as Integer, Width as Integer, Height as Integer, UseColours As Boolean) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Graphics & Pictures MBS Picture Plugin 8.7 ✅ Yes ✅ Yes ❌ No ✅ Yes All
Copies pixels from one picture into another picture with some options.

Returns true on success and false on failure.

This function has 4 behaviors depending on the parameters:

1. If mask is nil and no ForeColour and MaskColour values are passed, the pixels a copied to the destination picture.

2. But if there is a mask, the pixels are copied with applying the mask.

3. If the mask color is not defined, the the pixels are filled with the fore color applying the mask.

4. As the last variation the pixels are copied and the forecolor, the mask color or black is used with the image as the mask. If UseColours parameter is false black is used for this.

Parameters:
Image: the source picture, must not be nil.
Mask: the mask picture, can be nil.
DestX: destination position
DestY: destination position
SourceX: source position
SourceY: source position
Width: width of the area to copy
Height: height of the area to copy
UseColours: whether to use the mask colour.
ForeColour: the fore colour, optional, can be integer or color
MaskColour: the mask color, optional, can be integer or color

This function is 5 times in the plugin defined to implement having the last two parameters optional and either integer or color. You can pass a negative number for MaskColour or ForeColour to disable this parameter.

The destination image (self) can be either 24 bit or 32 bit.

See also:

Some examples using this method:

Picture.CombineMBS(Image As Picture, Mask As Picture, DestX as Integer, DestY as Integer, SourceX as Integer, SourceY as Integer, Width as Integer, Height as Integer, UseColours As Boolean, ForeColour As color) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Graphics & Pictures MBS Picture Plugin 8.7 ✅ Yes ✅ Yes ❌ No ✅ Yes All
Copies pixels from one picture into another picture with some options.
Example
dim DestImage As Picture
dim Image As Picture
dim Mask As Picture
dim DestX as Integer=100
dim DestY as Integer=100
dim SourceX as Integer=0
dim SourceY as Integer=0
dim Width as Integer=500
dim Height as Integer=500
dim UseColours as Boolean = true
dim ForeColour as color = &cFF0000

image=LogoMBS(500)
Mask=nil
DestImage=New Picture(700,700,32)

if DestImage.CombineMBS(image,Mask,DestX,DestY,SourceX,SourceY,Width,Height,UseColours,ForeColour) then
window1.Backdrop=DestImage
end if

Returns true on success and false on failure.

This function has 4 behaviors depending on the parameters:

1. If mask is nil and no ForeColour and MaskColour values are passed, the pixels a copied to the destination picture.

2. But if there is a mask, the pixels are copied with applying the mask.

3. If the mask color is not defined, the the pixels are filled with the fore color applying the mask.

4. As the last variation the pixels are copied and the forecolor, the mask color or black is used with the image as the mask. If UseColours parameter is false black is used for this.

Parameters:
Image: the source picture, must not be nil.
Mask: the mask picture, can be nil.
DestX: destination position
DestY: destination position
SourceX: source position
SourceY: source position
Width: width of the area to copy
Height: height of the area to copy
UseColours: whether to use the mask colour.
ForeColour: the fore colour, optional, can be integer or color
MaskColour: the mask color, optional, can be integer or color

This function is 5 times in the plugin defined to implement having the last two parameters optional and either integer or color. You can pass a negative number for MaskColour or ForeColour to disable this parameter.

The destination image (self) can be either 24 bit or 32 bit.

See also:

Some examples using this method:

Picture.CombineMBS(Image As Picture, Mask As Picture, DestX as Integer, DestY as Integer, SourceX as Integer, SourceY as Integer, Width as Integer, Height as Integer, UseColours As Boolean, ForeColour As color, MaskColour As color) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Graphics & Pictures MBS Picture Plugin 8.7 ✅ Yes ✅ Yes ❌ No ✅ Yes All
Copies pixels from one picture into another picture with some options.

Returns true on success and false on failure.

This function has 4 behaviors depending on the parameters:

1. If mask is nil and no ForeColour and MaskColour values are passed, the pixels a copied to the destination picture.

2. But if there is a mask, the pixels are copied with applying the mask.

3. If the mask color is not defined, the the pixels are filled with the fore color applying the mask.

4. As the last variation the pixels are copied and the forecolor, the mask color or black is used with the image as the mask. If UseColours parameter is false black is used for this.

Parameters:
Image: the source picture, must not be nil.
Mask: the mask picture, can be nil.
DestX: destination position
DestY: destination position
SourceX: source position
SourceY: source position
Width: width of the area to copy
Height: height of the area to copy
UseColours: whether to use the mask colour.
ForeColour: the fore colour, optional, can be integer or color
MaskColour: the mask color, optional, can be integer or color

This function is 5 times in the plugin defined to implement having the last two parameters optional and either integer or color. You can pass a negative number for MaskColour or ForeColour to disable this parameter.

The destination image (self) can be either 24 bit or 32 bit.

See also:

Some examples using this method:

Picture.CombineMBS(Image As Picture, Mask As Picture, DestX as Integer, DestY as Integer, SourceX as Integer, SourceY as Integer, Width as Integer, Height as Integer, UseColours As Boolean, ForeColour as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Graphics & Pictures MBS Picture Plugin 8.7 ✅ Yes ✅ Yes ❌ No ✅ Yes All
Copies pixels from one picture into another picture with some options.

Returns true on success and false on failure.

This function has 4 behaviors depending on the parameters:

1. If mask is nil and no ForeColour and MaskColour values are passed, the pixels a copied to the destination picture.

2. But if there is a mask, the pixels are copied with applying the mask.

3. If the mask color is not defined, the the pixels are filled with the fore color applying the mask.

4. As the last variation the pixels are copied and the forecolor, the mask color or black is used with the image as the mask. If UseColours parameter is false black is used for this.

Parameters:
Image: the source picture, must not be nil.
Mask: the mask picture, can be nil.
DestX: destination position
DestY: destination position
SourceX: source position
SourceY: source position
Width: width of the area to copy
Height: height of the area to copy
UseColours: whether to use the mask colour.
ForeColour: the fore colour, optional, can be integer or color
MaskColour: the mask color, optional, can be integer or color

This function is 5 times in the plugin defined to implement having the last two parameters optional and either integer or color. You can pass a negative number for MaskColour or ForeColour to disable this parameter.

The destination image (self) can be either 24 bit or 32 bit.

See also:

Some examples using this method:

Picture.CombineMBS(Image As Picture, Mask As Picture, DestX as Integer, DestY as Integer, SourceX as Integer, SourceY as Integer, Width as Integer, Height as Integer, UseColours As Boolean, ForeColour as Integer, MaskColour as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Graphics & Pictures MBS Picture Plugin 8.7 ✅ Yes ✅ Yes ❌ No ✅ Yes All
Copies pixels from one picture into another picture with some options.
Example
dim DestImage As Picture
dim Image As Picture
dim Mask As Picture
dim DestX as Integer=100
dim DestY as Integer=100
dim SourceX as Integer=0
dim SourceY as Integer=0
dim Width as Integer=500
dim Height as Integer=500

image=LogoMBS(500)
Mask=nil
DestImage=New Picture(700,700,32)

if DestImage.CombineMBS(image,Mask,DestX,DestY,SourceX,SourceY,Width,Height,true,&h777777,&h777777) then
window1.Backdrop=DestImage
end if

Returns true on success and false on failure.

This function has 4 behaviors depending on the parameters:

1. If mask is nil and no ForeColour and MaskColour values are passed, the pixels a copied to the destination picture.

2. But if there is a mask, the pixels are copied with applying the mask.

3. If the mask color is not defined, the the pixels are filled with the fore color applying the mask.

4. As the last variation the pixels are copied and the forecolor, the mask color or black is used with the image as the mask. If UseColours parameter is false black is used for this.

Parameters:
Image: the source picture, must not be nil.
Mask: the mask picture, can be nil.
DestX: destination position
DestY: destination position
SourceX: source position
SourceY: source position
Width: width of the area to copy
Height: height of the area to copy
UseColours: whether to use the mask colour.
ForeColour: the fore colour, optional, can be integer or color
MaskColour: the mask color, optional, can be integer or color

This function is 5 times in the plugin defined to implement having the last two parameters optional and either integer or color. You can pass a negative number for MaskColour or ForeColour to disable this parameter.

The destination image (self) can be either 24 bit or 32 bit.

See also:

Some examples using this method:

Picture.CombineMBS(Image As Picture, PreMultipliedSource as boolean, Mask As Picture, DestX as Integer, DestY as Integer, SourceX as Integer, SourceY as Integer, Width as Integer, Height as Integer, UseColours As Boolean) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Graphics & Pictures MBS Picture Plugin 9.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Copies pixels from one picture into another picture with some options.

Returns true on success and false on failure.

This function has 4 behaviors depending on the parameters:

1. If mask is nil and no ForeColour and MaskColour values are passed, the pixels a copied to the destination picture.

2. But if there is a mask, the pixels are copied with applying the mask.

3. If the mask color is not defined, the the pixels are filled with the fore color applying the mask.

4. As the last variation the pixels are copied and the forecolor, the mask color or black is used with the image as the mask. If UseColours parameter is false black is used for this.

Parameters:
Image: the source picture, must not be nil.
PreMultipliedSource: Optional parameter. If true the image must be premultiplied. Default is false.
Mask: the mask picture, can be nil.
DestX: destination position
DestY: destination position
SourceX: source position
SourceY: source position
Width: width of the area to copy
Height: height of the area to copy
UseColours: whether to use the mask colour.
ForeColour: the fore colour, optional, can be integer or color
MaskColour: the mask color, optional, can be integer or color

This function is 5 times in the plugin defined to implement having the last two parameters optional and either integer or color. You can pass a negative number for MaskColour or ForeColour to disable this parameter.

The destination image (self) can be either 24 bit or 32 bit.

See also:

Some examples using this method:

Picture.CombineMBS(Image As Picture, PreMultipliedSource as boolean, Mask As Picture, DestX as Integer, DestY as Integer, SourceX as Integer, SourceY as Integer, Width as Integer, Height as Integer, UseColours As Boolean, ForeColour As color) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Graphics & Pictures MBS Picture Plugin 9.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Copies pixels from one picture into another picture with some options.

Returns true on success and false on failure.

This function has 4 behaviors depending on the parameters:

1. If mask is nil and no ForeColour and MaskColour values are passed, the pixels a copied to the destination picture.

2. But if there is a mask, the pixels are copied with applying the mask.

3. If the mask color is not defined, the the pixels are filled with the fore color applying the mask.

4. As the last variation the pixels are copied and the forecolor, the mask color or black is used with the image as the mask. If UseColours parameter is false black is used for this.

Parameters:
Image: the source picture, must not be nil.
PreMultipliedSource: Optional parameter. If true the image must be premultiplied. Default is false.
Mask: the mask picture, can be nil.
DestX: destination position
DestY: destination position
SourceX: source position
SourceY: source position
Width: width of the area to copy
Height: height of the area to copy
UseColours: whether to use the mask colour.
ForeColour: the fore colour, optional, can be integer or color
MaskColour: the mask color, optional, can be integer or color

This function is 5 times in the plugin defined to implement having the last two parameters optional and either integer or color. You can pass a negative number for MaskColour or ForeColour to disable this parameter.

The destination image (self) can be either 24 bit or 32 bit.

See also:

Some examples using this method:

Picture.CombineMBS(Image As Picture, PreMultipliedSource as boolean, Mask As Picture, DestX as Integer, DestY as Integer, SourceX as Integer, SourceY as Integer, Width as Integer, Height as Integer, UseColours As Boolean, ForeColour As color, MaskColour As color) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Graphics & Pictures MBS Picture Plugin 9.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Copies pixels from one picture into another picture with some options.

Returns true on success and false on failure.

This function has 4 behaviors depending on the parameters:

1. If mask is nil and no ForeColour and MaskColour values are passed, the pixels a copied to the destination picture.

2. But if there is a mask, the pixels are copied with applying the mask.

3. If the mask color is not defined, the the pixels are filled with the fore color applying the mask.

4. As the last variation the pixels are copied and the forecolor, the mask color or black is used with the image as the mask. If UseColours parameter is false black is used for this.

Parameters:
Image: the source picture, must not be nil.
PreMultipliedSource: Optional parameter. If true the image must be premultiplied. Default is false.
Mask: the mask picture, can be nil.
DestX: destination position
DestY: destination position
SourceX: source position
SourceY: source position
Width: width of the area to copy
Height: height of the area to copy
UseColours: whether to use the mask colour.
ForeColour: the fore colour, optional, can be integer or color
MaskColour: the mask color, optional, can be integer or color

This function is 5 times in the plugin defined to implement having the last two parameters optional and either integer or color. You can pass a negative number for MaskColour or ForeColour to disable this parameter.

The destination image (self) can be either 24 bit or 32 bit.

See also:

Some examples using this method:

Picture.CombineMBS(Image As Picture, PreMultipliedSource as boolean, Mask As Picture, DestX as Integer, DestY as Integer, SourceX as Integer, SourceY as Integer, Width as Integer, Height as Integer, UseColours As Boolean, ForeColour as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Graphics & Pictures MBS Picture Plugin 9.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Copies pixels from one picture into another picture with some options.

Returns true on success and false on failure.

This function has 4 behaviors depending on the parameters:

1. If mask is nil and no ForeColour and MaskColour values are passed, the pixels a copied to the destination picture.

2. But if there is a mask, the pixels are copied with applying the mask.

3. If the mask color is not defined, the the pixels are filled with the fore color applying the mask.

4. As the last variation the pixels are copied and the forecolor, the mask color or black is used with the image as the mask. If UseColours parameter is false black is used for this.

Parameters:
Image: the source picture, must not be nil.
PreMultipliedSource: Optional parameter. If true the image must be premultiplied. Default is false.
Mask: the mask picture, can be nil.
DestX: destination position
DestY: destination position
SourceX: source position
SourceY: source position
Width: width of the area to copy
Height: height of the area to copy
UseColours: whether to use the mask colour.
ForeColour: the fore colour, optional, can be integer or color
MaskColour: the mask color, optional, can be integer or color

This function is 5 times in the plugin defined to implement having the last two parameters optional and either integer or color. You can pass a negative number for MaskColour or ForeColour to disable this parameter.

The destination image (self) can be either 24 bit or 32 bit.

See also:

Some examples using this method:

Picture.CombineMBS(Image As Picture, PreMultipliedSource as boolean, Mask As Picture, DestX as Integer, DestY as Integer, SourceX as Integer, SourceY as Integer, Width as Integer, Height as Integer, UseColours As Boolean, ForeColour as Integer, MaskColour as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Graphics & Pictures MBS Picture Plugin 9.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Copies pixels from one picture into another picture with some options.

Returns true on success and false on failure.

This function has 4 behaviors depending on the parameters:

1. If mask is nil and no ForeColour and MaskColour values are passed, the pixels a copied to the destination picture.

2. But if there is a mask, the pixels are copied with applying the mask.

3. If the mask color is not defined, the the pixels are filled with the fore color applying the mask.

4. As the last variation the pixels are copied and the forecolor, the mask color or black is used with the image as the mask. If UseColours parameter is false black is used for this.

Parameters:
Image: the source picture, must not be nil.
PreMultipliedSource: Optional parameter. If true the image must be premultiplied. Default is false.
Mask: the mask picture, can be nil.
DestX: destination position
DestY: destination position
SourceX: source position
SourceY: source position
Width: width of the area to copy
Height: height of the area to copy
UseColours: whether to use the mask colour.
ForeColour: the fore colour, optional, can be integer or color
MaskColour: the mask color, optional, can be integer or color

This function is 5 times in the plugin defined to implement having the last two parameters optional and either integer or color. You can pass a negative number for MaskColour or ForeColour to disable this parameter.

The destination image (self) can be either 24 bit or 32 bit.

See also:

Some examples using this method:

Picture.CombineMBS(Mode as Integer, SecondPicture As Picture, X as Integer = 0, Y as Integer = 0, Width as Integer = 0, Height as Integer = 0) as picture

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Graphics & Pictures MBS Picture Plugin 14.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Combines pixels of two images with the given mode.
Example
dim pic as picture // some picture
dim other as picture // some other picture
dim result as picture = pic.CombineMBS(1, other)

// effects are made like this. If you have a suggestion for a new effect,
// send your suggestion to MBS support:
Function Combine(x as Integer, y as Integer) as Integer
Return BitwiseXor(x,y)
End Function

Each pixel is sent through an operation for each channel.
X, Y, Width and Height can limit effect of a certain portion of the source image.

Modes:
1Bitwise XOR
2Bitwise OR
3Bitwise AND
4Min
5Max
6AddPin (add with limit)
7AddOver (add with overflow)
8Difference
9Difference squared (with limit 255)
10Sub Pin (sub with limit)

See also:

Some examples using this method:

Blog Entries

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


The biggest plugin in space...