This method pastes a raster image into another raster image.
Public Function PasteImage(bottomImage As System.Drawing.Image, angle As Integer, xTurn As Boolean, yTurn As Boolean, transLevel As Integer, transColor As Boolean, transRed As Byte, transGreen As Byte, transBlue As Byte, backRed As Byte, backGreen As Byte, backBlue As Byte, x As Integer, y As Integer, clip As Boolean) As Boolean
public bool PasteImage(System.Drawing.Image bottomImage, int angle, bool xTurn, bool yTurn, int transLevel, bool transColor, byte transRed, byte transGreen, byte transBlue, byte backRed, byte backGreen, byte backBlue, int x, int y, bool clip);
Parameters
bottomImage
The handle of the base image. This is
the image onto which another image is pasted (supports 1, 4, 8, 16,
24, 32 bit images)
angle
Angle of rotation (-35999 to 35999,
in 1/100 degree units)
xTurn
Reversal of the x axis (False(0): no
reversal, True (nonzero): reversal)
yTurn
Reversal of the y axis (False(0): no
reversal, True (nonzero): reversal)
transLevel
The level of transparency (from 0 to
255, as this value increases, the image referred to by the SourceImage property becomes
visible)
transColor
Sets whether or not there is a
transparent color in the image referred to by the SourceImage property (False(0)No
transparent color, True(nonzero):transparent color)
transRed
Sets the red component of the
transparent color in the image referred to by the SourceImage property (from 0 to
255)
transGreen
Sets the green component of the
transparent color in the image referred to by the SourceImage property (from 0 to
255)
transBlue
Sets the blue component of the
transparent color in the image referred to by the SourceImage property (from 0 to
255)
backRed
Sets the red component of the
background color. This color is drawn in the area not in either the
image referred to by the SourceImage property or the Handle
image (from 0 to 255)
backGreen
Sets the green component of the
background color. This color is drawn in the area not in either the
image referred to by the SourceImage property or the Handle
image (from 0 to 255)
backBlue
Sets the blue component of the
background color. This color is drawn in the area not in either the
image referred to by the SourceImage property or the Handle
image (from 0 to 255)
x,y
The attachment coordinates (in
pixels)
Clip
Sets whether or not the image is
clipped (False(0): no clipping, True (nonzero): clipping)
Return Value
Returns True if successful. Returns True if unsuccessful.
Explanation
The PasteImage method pastes one raster image into another raster image. The base image, (the image that another image is pasted into) is set into the BottomImage parameter. The image you want to paste into the base image is set in the SourceImage property. If using a mask image (to determine an area on the image to be processed), then set the image handle of the mask image in the SourceMask property. The PasteImage method supports 1, 4, 8, 16, 24, 32 bit images.
If successful the resulting raster image data is set in the DestinationImage property.
The Angle, xTurn, and yTurn parameters apply to the images in the SourceImage property and SourceMask property. The x,y parameters determine the coordinates on the base image (the image in the bottomImage parameter) where the CENTER of the SourceImage and SourceMask images are pasted. When the Clip parameter is True, the result is the same size as the base image (the image in the BottomImage parameter) and any excess is clipped. When the TransColor parameter is True, the color specified in the TransRed, TransGreen and TransBlue parameters is transparent.
The output image will be a 24 bit image. However, if bottomImage or the image you want to paste into the base image is a 32 bit image, then the output image will be a 32 bit image.