TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Michael Duffy
from: Dean Roddey
date: 1994-11-19 05:12:14
subject: Re: hpsMemory Bitmap que

Thanks Michael Duffy for your msg about Re: hpsMemory Bitmap ques, on
Wednesday, 11-16-1994!

Actually what you want to do is to create a memory device context, use
that to create a presentation space for that device context, then
create a bitmap of the size you want, and associate it with the PS.
Then you can draw into the PS just like drawing to the screen except
that the output is drawn to the bitmap.

Here are the calls to make

   __hdcShadow = DevOpenDC(pgthrCaller->habThread()
                           , OD_MEMORY
                           , "*"
                           , 4L
                           , apchDevData
                           , 0)

   __hpsShadow = GpiCreatePS(  pgthrCaller->habThread()
                               , __hdcShadow
                               , &szlHDC
                               , PU_PELS | GPIT_MICRO | GPIA_ASSOC)

   // Create an unitialized bitmap
    // .... __pbmhpShadow was set up here, but left it out
   __hbmShadow = GpiCreateBitmap( __hpsShadow
                                   , (BITMAPINFOHEADER2*)__pbmphShadow
                                   , 0L
                                   , NULL
                                   , NULL);

   if (GpiSetBitmap(__hpsShadow, __hbmShadow) == (HBITMAP)BMB_ERROR)
   {
   }


Keep in mind that these calls were pulled out of some of my existing
stuff and most of the grunt work of making sure everything went ok and
setting up the data for the calls was cut out to avoid posting a mega
message.

But, once you have done this, you can draw into __hpsShadow just like
any other PS. When you are done, then save the bitmap away or do
whatever you want with it.

___
 X KWQ/2 1.2b X If at first you don't succeed, put it out for beta test (KWQ Beta

--- Maximus/2 2.02

* Origin: Fernwood - your source for OS/2 files! (1:141/209)
SEEN-BY: 12/2442 54/54 620/243 624/50 632/348 640/820 690/660 711/409 410 413
SEEN-BY: 711/430 807 808 809 934 942 949 712/353 623 713/888 800/1
@PATH: 141/209 270/101 396/1 3615/50 229/2 12/2442 711/409 54/54 711/808 809
@PATH: 711/934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.