Article View: borland.public.cppbuilder.nativeapi
Article #12843Re: GDI Objects build up using CreateCompatibleDC and CreateCompatibleBitmap
From: LarryJ
Date: Sun, 16 Nov 2003 17:28
Date: Sun, 16 Nov 2003 17:28
39 lines
2322 bytes
2322 bytes
I changed the order of the delete functions as seen below. This has no
effect of the GDI Ojects number. The number of GDI Objects still increases
by two each time I run through this delete - create process. Is there a
working example of this delete create process in some sample code that I can
test and study?
delete PCForm->BGCanvas;
DeleteObject(hBMP1);
DeleteDC(hDC1);
//=== OR =====
DeleteObject(hBMP1);
delete PCForm->BGCanvas;
DeleteDC(hDC1);
In the create functions below I have to use the same Handle in both
functions or the new canvas will fail to work correctly. The canvas will
change colors for no reason when refreshed. So I can not place the hDC1 in
the bitmap create.
//works
hDC1 = CreateCompatibleDC(PCForm->Canvas->Handle);
hBMP1 = CreateCompatibleBitmap(PCForm->Canvas->Handle,
mychart->ClientWidth, mychart->ClientHeight);
//fails
hDC1 = CreateCompatibleDC(mychart->PCForm->Canvas->Handle);
hBMP1 = CreateCompatibleBitmap(hDC1, mychart->ClientWidth,
mychart->ClientHeight);
"Remy Lebeau (TeamB)" <gambit47.no.spam@no.spam.yahoo.com> wrote in message
news:3fb75960$1@newsgroups.borland.com...
>
> "LarryJ" <LarryJ33@ev1.net> wrote in message
> news:3fb7541b$1@newsgroups.borland.com...
>
> > DeleteDC(hDC1);
> > delete PCForm->BGCanvas;
>
Technical Details
Message-ID:
<3fb7b3b4@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3fb7541b$1@newsgroups.borland.com> <3fb75960$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,17187dcae4d9769f X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-11-16 09:39:25 PST Reply-To: "LarryJ" <LarryJ33@ev1.net> From: "LarryJ" <LarryJ33@ev1.net> Newsgroups: borland.public.cppbuilder.nativeapi References: <3fb7541b$1@newsgroups.borland.com> <3fb75960$1@newsgroups.borland.com> Subject: Re: GDI Objects build up using CreateCompatibleDC and CreateCompatibleBitmap Date: Sun, 16 Nov 2003 11:28:10 -0600 Lines: 41 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: 216.40.235.156 Message-ID: <3fb7b3b4@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1069003700 216.40.235.156 (16 Nov 2003 09:28:20 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail