🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms
Article #1853

Re: Copying Bitmaps

#1853
From: Michael Thurlkill 1/1029
Date: Wed, 04 Oct 1989 16:59
27 lines
2020 bytes
In article <1989Oct1.222918.14330@ux1.cso.uiuc.edu> mcdonald@aries.scs.uiuc.edu (Doug McDonald) writes:
>I am trying to write a Windows program that draws text on the screen
>from non-Windows bitmapped fonts. Question is, what is the fastest
>way to copy the bitmaps to the screen? They characters are in
>variable size arrays (i.e. variable number of bytes per row and
>rows per character). At the present I am using CreateBitmap on
>each single character, using Bitblt, and then junking the Windows
>Bitmap object. Ugh! Actually on my 20 MHz 286 it is not too slow - 
>maybe 1.8 sec per page. But on a 6Mhz AT............ snooooooze time.
>
As another person mentioned, it would be great to convert these to 
Windows fonts. If you want to keep doing it this way, here's a suggestion.
Create a memory DC compatible with the display. Draw or BitBlt your
set of characters into this DC. Keep this DC around the entire time your
application is active. Then, whenever you need to draw one of these
characters, you can quickly Bitblt from this DC. Keep in mind that this
method will potentially consume a large amount of memory, but it will be
very fast. If you look in heapwalk, you can see that this type of cacheing
is used by windows for some of the small bitmaps used for the standard
controls, min/max arrows, etc.
You may just want to keep this in memory while the font is "selected"
instead.

Mike

Disclaimer: These thoughts and opinions are my own. They should not be
mis-construed as being correct or in any way related to my employer.
Technical Details
Message-ID: <7953@microsoft.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!microsoft!michaelt
References: <1989Oct1.222918.14330@ux1.cso.uiuc.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!microsoft!michaelt
From: michaelt@microsoft.UUCP (Michael Thurlkill 1/1029)
Newsgroups: comp.windows.ms
Subject: Re: Copying Bitmaps
Message-ID: <7953@microsoft.UUCP>
Date: 4 Oct 89 16:59:19 GMT
References: <1989Oct1.222918.14330@ux1.cso.uiuc.edu>
Reply-To: michaelt@microsoft.UUCP (Michael Thurlkill 1/1029)
Organization: Microsoft Corp., Redmond WA
Lines: 27