Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

Trouble Using Picturebox control for Graphical bitmap images

$
0
0

I created an app in Visual Studio Express 2012 using C# which draws graphical shapes to a bitimap which is then loaded to a PictureBox on a Widows Form as the PictureBox Image.   The code snippets I used are shown below. :-

Graphics G;
Bitmap bmp = new Bitmap(982, 739);

  G = Graphics.FromImage(bmp);

  pictureBox1.SizeMode = PictureBoxSizeMode.Normal;

G.DrawPolygon(redPen, trnPoints);
pictureBox1.Image = bmp;

This all worked fine and the Graphic shape was visible when the  the PictureBox was on the  Windows Form.    I then decide to change the the layout of the Form and in Visual Studio designer placed a Tabcontrol with 4 pages on the Form and moved the PictureBox on to the  third page.   Now using the same code the graphic bitmap does not become visible.

Can anyone suggest why and what I may have overlooked when making the changes. ??


Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>