I have a picturebox as the main image and it has a filled rectangle drawn onto it. Then I have another picturebox which has an image and a label which has some text. I want to draw the second picturebox's image and the label's text onto the first picturebox's image and display it in a third picturebox.
I have the following code:
Dim BMP As New Bitmap(PicBanner.Image)
Dim g As Graphics = Graphics.FromImage(BMP)
Dim Brsh As New SolidBrush(Color.FromName(CBForeClr.SelectedItem))
g.DrawImageUnscaled(PicLogo.Image, PicLogo.Location.X, PicLogo.Location.Y)
g.DrawString(LblText.Text, LblText.Font, Brsh, LblText.Left, LblText.Top)
PicBanner.DrawToBitmap(BMP, New Rectangle(0, 0, PicPreview.Width, PicPreview.Height))
PicPreview.Image = BMP
Instead of drawing the picturebox's image and the text onto the first picturebox, it displays only the filled rectangle in the preview box.
What is wrong with my code?