Nim199 Posted July 16, 2008 Share Posted July 16, 2008 Hi all,I am really getting into VB.NET now, but have hit a brick wall.How can I take an image (bmp) and replace any colour with a texture?I have found one way, where you make the colour transparent, then make a new image where you paste the texture opn first, then layer over the transparented original image. Public Class Form1 Dim g As Graphics Dim img, img2 As Bitmap Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load img = New Bitmap(200, 200) g = Graphics.FromImage(img) g.DrawImage(PictureBox1.Image, 0, 0) img.MakeTransparent(Color.Black) ' Remove Black img2 = New Bitmap(200, 200) ' New Imgage g = Graphics.FromImage(img2) g.DrawImage(PictureBox2.Image, 0, 0) ' Add texture g.DrawImage(img, 0, 0) ' Add Overlay PictureBox3.Image = img2 End SubEnd Class I am sure there must be another way, and help would be great. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.