Article View: borland.public.cppbuilder.nativeapi
Article #923Re: How to use BitBlt with a HBITMAP handle ?
From: Asger Joergensen
Date: Tue, 18 Dec 2007 02:27
Date: Tue, 18 Dec 2007 02:27
52 lines
2806 bytes
2806 bytes
Thanks Remy Remy Lebeau (TeamB) says: > > "Asger Joergensen" <junk@Asger-P.dk> wrote in message > news:MPG.21d0abd3ce2daf26989982@newsgroups.borland.com... > > > So how do I get a HDC from a HBITMAP ? > > CreateCompatibleDC(), SelectObject(), and SelectPalette(), and > RealizePalette(). Do I need the palette in 24bit ? > > > I know I can assign the HBITMAP to a TBitmap->Handle > > but I'm not interested in an extra copy of the bitmap. > > Assigning an HBITMAP to a TBitmap does not make a copy. The TBitmap takes > ownership of the HBITMAP instead. I tried using the TBitmap Handle and it works, but I'm not sure if it will work corectly. The thing is that I an using a TImageList to hold some bitmaps, but I don't like the ImageList:Draw function, it makes some realy bad looking blended images + it is extremly slow. So I have written my own Draw function, but I need to get the bitmaps, since I use the scanlines in my draw function. Imagelist::GetBitmap uses Draw to return the image, so that would eat the speed I gained. I was thinking that I could use GetImageBitmap() but I would like it to work with the System Imagelist as well as with a user filled Imagelist. Do You know if the HBITMAP returned from GetImageBitmap() is valid when images are aded to the System Imagelist after a call to SHGetFileInfo() ? By valid I mean containing all images in the list. When You mentioned that TBitmap takes ownership I got my doubts. I have tried adding an OnChange event to the ImageList but that isn't called when the system adds images. Do You have some suggestions ? Thanks in advance Asger
Technical Details
Message-ID:
<MPG.21d14e86b29b3fb5989988@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder3.cambrium.nl!feed.tweaknews.nl!83.80.28.12.MISMATCH!multikabel.net!newsfeed10.multikabel.net!news.astraweb.com!newsrouter-eu.astraweb.com!newsfeed2.ip.tiscali.net!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<MPG.21d0abd3ce2daf26989982@newsgroups.borland.com> <4766b489$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,c61a90c52be804ea X-Google-Attributes: gid10cc67,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: Asger Joergensen <junk@Asger-P.dk> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: How to use BitBlt with a HBITMAP handle ? Date: Tue, 18 Dec 2007 03:27:38 +0100 Message-ID: <MPG.21d14e86b29b3fb5989988@newsgroups.borland.com> References: <MPG.21d0abd3ce2daf26989982@newsgroups.borland.com> <4766b489$1@newsgroups.borland.com> Organization: Asger-P MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit User-Agent: MicroPlanet-Gravity/2.70.2067 NNTP-Posting-Host: 83.73.201.25 X-Trace: newsgroups.borland.com 1197944856 83.73.201.25 (17 Dec 2007 18:27:36 -0700) Lines: 52 Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder3.cambrium.nl!feed.tweaknews.nl!83.80.28.12.MISMATCH!multikabel.net!newsfeed10.multikabel.net!news.astraweb.com!newsrouter-eu.astraweb.com!newsfeed2.ip.tiscali.net!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail