drawline

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Feb 2008
Posts: 98
Reputation: Nemoticchigga is an unknown quantity at this point 
Solved Threads: 2
Nemoticchigga Nemoticchigga is offline Offline
Junior Poster in Training

drawline

 
0
  #1
Sep 18th, 2008
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?
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 2,847
Reputation: niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute 
Solved Threads: 298
Moderator
Featured Poster
niek_e's Avatar
niek_e niek_e is offline Offline
Roasting Maven

Re: drawline

 
0
  #2
Sep 18th, 2008
Could you post the code that you're using?
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 98
Reputation: Nemoticchigga is an unknown quantity at this point 
Solved Threads: 2
Nemoticchigga Nemoticchigga is offline Offline
Junior Poster in Training

Re: drawline

 
0
  #3
Sep 18th, 2008
This is the code I use to load the image

  1. Map->Image = System::Drawing::Image::FromFile("test_map1.bmp");
  2. Map->Height = Map->Image->Height;
  3. Map->Width = Map->Image->Width;
  4. Map->Left = 0;
  5. Map->Top = 0;
  6. this->Height = Map->Image->Height;
  7. this->Width = Map->Image->Width;

And this is what I want to draw on it.

  1. Graphics^ grfx = Map->CreateGraphics();
  2. Pen^ myPen = gcnew Pen(Color::Yellow, 3);
  3.  
  4. grfx->DrawLine(myPen, this->Map->Width/2, this->Map->Height/2, this->Map->Width/2 + 10, this->Map->Height/2);
  5. grfx->DrawLine(myPen, this->Map->Width/2, this->Map->Height/2, this->Map->Width/2, this->Map->Height/2 - 10);
  6. grfx->DrawLine(myPen, this->Map->Width/2, this->Map->Height/2, this->Map->Width/2 - 10, this->Map->Height/2);
  7. grfx->DrawLine(myPen, this->Map->Width/2, this->Map->Height/2, this->Map->Width/2, this->Map->Height/2 + 20);
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC