GdPicture.NET Reference Guide
DrawGdPictureImageTransparency Method (GdPictureImaging)
Example 





GdPicture14 Namespace > GdPictureImaging Class : DrawGdPictureImageTransparency Method
GdPicture Image Identifier. Specifies the image to be drawn from.
GdPicture Image Identifier. specifies the image to draw on.
Transparency to apply to the drawn image [0 ; 255]. 0 means full opacity and 255 full transparency.
Specifies the x-coordinate in pixels of the upper-left corner of the destination rectangle at which to draw the image.
Specifies the y-coordinate in pixels of the upper-left corner of the destination rectangle at which to draw the image.
Specifies the width, in pixels, of the destination rectangle at which to draw the image.
Specifies the height, in pixels, of the destination rectangle at which to draw the image.
A member of the Drawing2D.InterPolationMode enumeration.
Draws a GdPicture image into another GdPicture image applying a transparency effect.
Syntax

Parameters

SrcImage
GdPicture Image Identifier. Specifies the image to be drawn from.
DstImage
GdPicture Image Identifier. specifies the image to draw on.
Transparency
Transparency to apply to the drawn image [0 ; 255]. 0 means full opacity and 255 full transparency.
DstLeft
Specifies the x-coordinate in pixels of the upper-left corner of the destination rectangle at which to draw the image.
DstTop
Specifies the y-coordinate in pixels of the upper-left corner of the destination rectangle at which to draw the image.
DstWidth
Specifies the width, in pixels, of the destination rectangle at which to draw the image.
DstHeight
Specifies the height, in pixels, of the destination rectangle at which to draw the image.
InterpolationMode
A member of the Drawing2D.InterPolationMode enumeration.

Return Value

A member of the GdPictureStatus enumeration.
Example
Rendering a blue image over a red image using defined transparency and saving the result into a png file.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
    System.Drawing.Drawing2D.InterpolationMode iMode = System.Drawing.Drawing2D.InterpolationMode.Default;
 
    int width = 180;
    int height = 180;
    int transparency = 100;
 
    // Create images.
    int backImage = gdpictureImaging.CreateNewGdPictureImage(340, 340, 24, 0);
    int redImage = gdpictureImaging.CreateNewGdPictureImage(width, height, 24, gdpictureImaging.ARGBI(255, 255, 0, 0));
    int blueImage = gdpictureImaging.CreateNewGdPictureImage(width, height, 24, gdpictureImaging.ARGBI(255, 0, 0, 255));
 
    // Render a red image without transparency.
    gdpictureImaging.DrawGdPictureImageTransparency(redImage, backImage, 0, 25, 25, width, height, iMode);
 
    // Render a blue image with defined transparency.
    gdpictureImaging.DrawGdPictureImageTransparency(blueImage, backImage, transparency, 135, 135, width, height, iMode);
 
    gdpictureImaging.SaveAsPNG(backImage, "output.png");
 
    // Release used resources
    gdpictureImaging.ReleaseGdPictureImage(redImage);
    gdpictureImaging.ReleaseGdPictureImage(blueImage);
    gdpictureImaging.ReleaseGdPictureImage(backImage);
}
See Also

Reference

GdPictureImaging Class
GdPictureImaging Members