|
From: Daniel G. <sp...@ho...> - 2002-10-24 09:45:07
|
Yes you need to serialise the information to a file. I'll see if I can dig
up some information on this, but that's what you need to do.
>From: "Vlada Djurovic" <dj...@im...>
>To: "'DevC++ help'" <dev...@li...>
>Subject: [Dev-C++] drawing in Windows
>Date: Thu, 24 Oct 2002 10:32:16 +0200
>
>Hi, everybody
>Here's my problem: I'm trying to write a simple drawing app (just for
>exercise) and so far its been going OK. I can draw lines in client area in
>different colors, but when ever I minimize or maximize the window, or
>something similar happenes, all the content of the window is gone. I tried
>to use a memory DC an bitmap to save the contents in, and BitBlt it back in
>response to WM_PAINT message, but the program just "froze". Can anybody
>give me a hint how to do it? Here's the code used for drawing lines without
>any restoring parts:
>
> case WM_MOUSEMOVE:
> {
> switch(iTool) /* iTool is used for dtetrmining which
>drawing tool is selected(line, rect etc.)*/
> {
> case 0:
> {
> if(wParam==MK_LBUTTON) /*if line is selected
>(itool=0) and left button presed*/
> {
> HDC hDC=GetDC(hwnd);
>
> HPEN hPen=CreatePen(PS_SOLID,iCurWidth,crCurColor);
> HPEN hOldPen=(HPEN)SelectObject(hDC,hPen);
> CLine* pLine=new
>CLine(ptPrevPos,MAKEPOINTS(lParam),iCurWidth,crCurColor); /*create new line
>object*/
> pLine->DrawLine(hDC);
> ptPrevPos=MAKEPOINTS(lParam);
> SelectObject(hDC,hOldPen);
> DeleteDC(hDC);
> }
> }
> break;
> case 1: /* nothing here yet*/
> break;
> }
> }
_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
|