RE: Win32 page flipping

new topic     » topic index » view thread      » older message » newer message

Great, that should be what I need.
Yes, you're right; there are no controls in the window - just written directly.

Actually, I will just use a single v. large sized bitmap, and use stretchBlt to
transfer it, because the text sizes don't seem to scale well.

Thanks.
==============================================
 _______<-------------------\__
/  _____<--------------------__|===
| |_    <-------------------/
\__| Patrick Barnes



-----Original Message-----
From: Pete Lomax [mailto:petelomax at blueyonder.co.uk]
Sent: Tuesday, 14 January 2003 14:45
To: EUforum
Subject: Re: Win32 page flipping



On Tue, 14 Jan 2003 14:00:43 +1100, Patrick.Barnes at transgrid.com.au
wrote:

>
>I have several pages of graphics and text (wPuts'ed) that I wish to switch
>between without flickering. How do I draw graphics and text into a bitmap, so
>that I can blit it on to the screen in one go?

Flickering? Do you use repaintWindow() alot? I found I reduced alot of
flicker with surrounding toolbars, buttons, border etc which did not
need updating by invoking my oppaint routine directly.

Otherwise: I assume you already have code which writes direct to the
window, so use something like this:

	size = getClientRect(win) -- returns {x1,y1,x2,y2}
	size[3]-=size[1]
	size[4]-=size[2]
	If Bitmap=0 then --[**1**]
		Bitmap=create(Pixmap,"",0,0,0,size[3],size[4],0)
	end if
	setCtlSize(Bitmap,size[3],size[4])


then setFont/setPenColor/drawRectangle/drawLine/bitBlt/stretchBlt/
setTextColor/wPuts as usual, only to your Bitmap, then just:

	copyBlt(win, 0, 0, Bitmap)

Pete
 [**1**] I create my bitmap precisely once, maximum size since I open
the window maximised, and resized it before each repaint.

==^^===============================================================
This email was sent to: Patrick.Barnes at transgrid.com.au


TOPICA - Start your own email discussion group. FREE!


***********************************************************************




***********************************************************************

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu