Article View: borland.public.cppbuilder.nativeapi
Article #14199Re: Saving BITMAP to file
From: Gnum
Date: Thu, 04 Sep 2003 03:18
Date: Thu, 04 Sep 2003 03:18
40 lines
2307 bytes
2307 bytes
One more idea. You could send it to Clipboard! And then open by Photoshop, Photopaint, Fireworks - anything that could Paste an image and store it... Or you wanna create .AVI as Screen capture sequence? Gnum "CC" <Xcurtc@tmscorp.com> wrote in message news:3f560dbd$1@newsgroups.borland.com... > Greetings all. > Thanks to code supplied by Bob Gonder, > I have code that will take a snapshot of the desktop window, and copy to a > bitmap structure. > Does anyone have any good code references for saving an HBITMAP to a file? > (i think i > need a device independent version of the bitmap also before saving to file?) > Many thanks, > CurtC > > Example code: > HDC hScreenDC=NULL; > HDC hmemDC=NULL; > HBITMAP hmemBM=NULL; > int ScreenWidth=-1; > int ScreenHeight=-1; > hScreenDC = GetWindowDC(0); > ScreenWidth = GetDeviceCaps(hScreenDC, HORZRES); > ScreenHeight = GetDeviceCaps(hScreenDC, VERTRES); > hmemDC = CreateCompatibleDC( hScreenDC ); > hmemBM = CreateCompatibleBitmap(hScreenDC,ScreenWidth,ScreenHeight); > SelectObject(hmemDC, hmemBM); > BitBlt(hmemDC, 0, 0, ScreenWidth, ScreenHeight, hScreenDC, 0, > 0,SRCCOPY); > > Hmmm- How do I save contents to file?? > >
Technical Details
Message-ID:
<3f56aea7$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!newshosting.com!news-xfer1.atl.newshosting.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3f560dbd$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,c4a703bacbe5d797 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-09-03 20:28:21 PST Reply-To: "Gnum" <alexanderL@marketpulse.biz> From: "Gnum" <alexanderL@marketpulse.biz> Newsgroups: borland.public.cppbuilder.nativeapi References: <3f560dbd$1@newsgroups.borland.com> Subject: Re: Saving BITMAP to file Date: Thu, 4 Sep 2003 15:18:29 +1200 Lines: 42 Organization: MarketPulse X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 203.109.192.137 Message-ID: <3f56aea7$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1062645415 203.109.192.137 (3 Sep 2003 20:16:55 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!newshosting.com!news-xfer1.atl.newshosting.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail