🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.misc
Article #2704

Re: When to take a snapshot?

#2704
From: John Grant
Date: Mon, 11 Jan 1993 22:07
30 lines
1474 bytes
In article <1993Jan7.141729.2931@brandonu.ca> dueck@brandonu.ca writes:
>I have an application that draws graphics in a window. I want to save the
>contents of the window across task switches so they can be restored when my
>application is reactivated. At what point should I take a snapshot of the
>screen? 
	When you receive WM_PAINT and draw your screen, also save
	the whole thing as a bitmap.  If you get WM_SIZE, then kill
	the bitmap, it is now invalid.  You may also kill it when
	you change the picture yourself.

	Subsequently, when you get WM_PAINT messages, if the bitmap
	still exists, then BitBlt it to the screen, to redraw:

	static HBITMAP hbitmap=NULL;
	...
		case WM_PAINT:	if(hbitmap){
				  BitBlt using hbitmap
				}else{
				  hdc=BeginPaint(...)
				  DrawMyPicture();
				  hbitmap=SaveMyPictureAsBitmap();
				  EndPaint(...);
				}
				break;

	If you need more details, e-mail me and I'll send you some code.
-- 
John A. Grant						jagrant@emr1.emr.ca
Airborne Geophysics
Geological Survey of Canada, Ottawa
Technical Details
Message-ID: <1993Jan11.220717.650@emr1.emr.ca>
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!howland.reston.ans.net!spool.mu.edu!torn!nott!emr1!jagrant
References: <1993Jan7.141729.2931@brandonu.ca>

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.ms-windows.programmer.misc
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!howland.reston.ans.net!spool.mu.edu!torn!nott!emr1!jagrant
From: jagrant@emr1.emr.ca (John Grant)
Subject: Re: When to take a snapshot?
Message-ID: <1993Jan11.220717.650@emr1.emr.ca>
Organization: Energy, Mines, and Resources, Ottawa
References: <1993Jan7.141729.2931@brandonu.ca>
Date: Mon, 11 Jan 1993 22:07:17 GMT
Lines: 30