Put two Buttons on your form named btnBlendShapes and btnDrawImages respectively. Add a picturebox, named pic. Type this : Import this
Imports System.Drawing.Imaging
Then,
Private Sub btnBlendShapes\_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBlendShapes.Click
'alpha numbers has to be between values 0 and 255.
'alpha 0 is fully transparent while alpha 255 is fully opaque
'of course, change any of the alpha values below depending on which color you want to be more or
'less transparent or opaque
'the first apha value to be fully visible
Dim alphaValue As Integer = 255
'the second alpha value will have some transparency
Dim alphaValue2 As Integer = 155
'create 2 brushes. 1 brush with the first alpha value and the second brush using the 2nd alpha
'value
Dim aBrush As SolidBrush = New SolidBrush(Color.FromArgb(alphaValue, Color.Fuchsia))
Dim aBrush2 As SolidBrush = New SolidBrush(Color.FromArgb(alphaValue2, Color.Goldenrod))
'draw 2 rectangles, 1 with the first brush and the other rectangle using the 2nd brush
pic.CreateGraphics.FillRectangle(aBrush, 0, 0, 100, 100)
pic.CreateGraphics.FillRectangle(aBrush2, 50, 50, 100, 100)
End Sub
Private Sub btnDrawImages\_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDrawImages.Click
'the 2 images to use for the alpha blend. you may have to change the image paths to where the
'images are on your computer.
Dim imagePath As String = "AW-9TriplePan2.gif"
Dim imagePath2 As String = "AW-9TriplePan2.gif"
'create 2 new images with the above filenames
Dim img As Image = Image.FromFile(imagePath)
Dim img2 As Image = Image.FromFile(imagePath2)
'create 2 new ojects to use the ImageAttrubute class and the ColorMatrix Class
Dim i As ImageAttributes = New ImageAttributes
Dim c As ColorMatrix = New ColorMatrix
'draw both images onto the picturebox control. the first image will not have any changes made to
'any of its attributes.
pic.CreateGraphics.DrawImage(img, 0, 0, 200, 150)
'with matrix33 you can adjust the images alpha value
'values I think are to be between 0 and 1. Ex: .3, .25, or .5 ect....
c.Matrix33 = 0.45
i.SetColorMatrix(c)
'this 2nd image will have its maxtrix3