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?

Could you post the code that you're using?

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);
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.