Draw shapes based on the cursor location
Good Day everyone.
Can anyone provide some overview, possibly some flow on the program that i currently trying to do? Possibly some example that I can refer to.
I already have a menu to select shapes that i want to draw.
I wanted to draw a shape anywhere in the client area based on my mouse clicked. Let say a triangle.
The location of mouse pointer, in the centre of my triangle.
As long as I didn't choose new shape to draw, I can keep drawing new triangle anywhere in the client area.
I'm using polyline to draw my shape. my question is, what should I include inside my programming in order for my program able to perform the above task?
Regard,
Kurogane.
Re: Draw shapes based on the cursor location
Quote:
my question is, what should I include inside my programming in order for my program able to perform the above task?
I wonder what would "include" really mean there? Typically people ask what they should do, or how to act about drawing, but not what they should "include inside their programming." Please rephrase to let us understand your question.
Re: Draw shapes based on the cursor location
sorry.. my bad. yeah. actually i was asking how should i program it? especially on the drawing part.
I am very grateful if some example can be included. thank you.
best regards,
Kurogane.
Re: Draw shapes based on the cursor location
one of the thing i dont know is:
Code:
case WM_CREATE:
hwndStatic = CreateWindow(TEXT("static"), TEXT(""),
WS_CHILD | WS_VISIBLE,
150, 80, 90, 25, hWnd, NULL, g_hinst, NULL);
break;
case WM_LBUTTONDOWN:
x = LOWORD (lParam);
y = HIWORD (lParam);
GetCursorPos(&coord);
break;
the above is my current code. the next step i want to do is the show the value of coordinate x and coordinate y inside my hwndstatic. how can i do that?
Re: Draw shapes based on the cursor location
1 Attachment(s)
Re: Draw shapes based on the cursor location