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
Watermark an image to another image
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim oGdPictureImaging As New GdPicture.GdPictureImaging
Dim ImageBackID As Integer = oGdPictureImaging.CreateGdPictureImageFromFile("image1.jpg")
Dim ImageWatermarkID As Integer = oGdPictureImaging.CreateGdPictureImageFromFile("image2.jpg")
' Drawing ImageBackID to the top left corner of ImageBackID.
oGdPictureImaging.DrawGdPictureImageTransparency(ImageWatermarkID, ImageBackID, 150, 0, 0, 200, 200, Drawing2D.InterpolationMode.HighQualityBicubic)
oGdPictureImaging.SaveAsJPEG(ImageBackID, "image3.jpg", 75)
oGdPictureImaging.ReleaseGdPictureImage(ImageBackID)
oGdPictureImaging.ReleaseGdPictureImage(ImageWatermarkID)
End Sub
Copying one image onto a section of another and setting the opacity to half.
Dim oGdPictureImaging As New GdPictureImaging
Dim SrcImage As Integer = oGdPictureImaging.CreateGdPictureImageFromFile("srcImage.png")
Dim DstImage As Integer = oGdPictureImaging.CreateGdPictureImageFromFile("destImage.png")
oGdPictureImaging.DrawGdPictureImageTransparency(SrcImage, DstImage, 128, 0, 0, 100, 100, Drawing2D.InterpolationMode.Bicubic)
oGdPictureImaging.SaveAsPNG(DstImage, "output.png")
oGdPictureImaging.ReleaseGdPictureImage(DstImage)
oGdPictureImaging.ReleaseGdPictureImage(SrcImage)
See Also

Reference

GdPictureImaging Class
GdPictureImaging Members