0

How do you draw on an image in visual studio 2005 and get it to stay? Ive can get it to draw, but it flickers on resize and disappears when the resize is done. Any ideas?

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by Nemoticchigga
0

This is the code I use to load the image

Map->Image = System::Drawing::Image::FromFile("test_map1.bmp");
			Map->Height = Map->Image->Height;
			Map->Width = Map->Image->Width;
			Map->Left = 0;
			Map->Top = 0;
			this->Height = Map->Image->Height;
			this->Width = Map->Image->Width;

And this is what I want to draw on it.

Graphics^ grfx = Map->CreateGraphics();
			Pen^ myPen = gcnew Pen(Color::Yellow, 3);

			grfx->DrawLine(myPen, this->Map->Width/2, this->Map->Height/2, this->Map->Width/2 + 10, this->Map->Height/2);
			grfx->DrawLine(myPen, this->Map->Width/2, this->Map->Height/2, this->Map->Width/2, this->Map->Height/2 - 10);
			grfx->DrawLine(myPen, this->Map->Width/2, this->Map->Height/2, this->Map->Width/2 - 10, this->Map->Height/2);
			grfx->DrawLine(myPen, this->Map->Width/2, this->Map->Height/2, this->Map->Width/2, this->Map->Height/2 + 20);
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.