| | |
drawline
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Feb 2008
Posts: 98
Reputation:
Solved Threads: 2
This is the code I use to load the image
And this is what I want to draw on it.
C++ Syntax (Toggle Plain Text)
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.
C++ Syntax (Toggle Plain Text)
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);
![]() |
Similar Threads
- polynomials (Java)
- Drawing lines by click two points (Java)
- How to draw a line (Java)
- drawing (Java)
- Parallel Lines Illusions: Very Tricky!!! (Java)
- Can u help me with hangman code in vb.net please :( (VB.NET)
- Please Check The Errors'..Dont know what else to do (C++)
- modifying all of the instances in an array at once (Java)
Other Threads in the C++ Forum
- Previous Thread: Select Row in TextBox
- Next Thread: Link two window forms
| Thread Tools | Search this Thread |
api array based beginner binary bitmap c++ c/c++ calculator char char* class classes coding compile compiler console conversion convert count data database delete desktop developer directshow dll dynamiccharacterarray email encryption error file forms fstream function functions game getline google graph homeworkhelper iamthwee ifstream input int integer java lib linkedlist linux list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct template templates test text tree unix url vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






