Give "UnDelphix" in Google, to find out.
It's not that difficult.

David Smith wrote:
> What is UnDelphiX?
> 
> --- On *Sat, 6/7/08, Fahri Reza /<[EMAIL PROTECTED]>/* wrote:
> 
>     From: Fahri Reza <[EMAIL PROTECTED]>
>     Subject: Re: [advanced_delphi] Directx Drawtext - Release memory problem
>     To: advanced_delphi@yahoogroups.com
>     Date: Saturday, June 7, 2008, 4:49 PM
> 
>     ----- Original Message ----- 
>     From: "Dimitris Botsis" <[EMAIL PROTECTED]>
> 
>     Hi all,
> 
>     I want to use drawtext on a directx surface in order to write some text;
>     For every call to drawtext I set font name, size,color,style etc, then I
>     drawtext and then I call release of canvas.
>     The problem is that that whole things has a memory leak or something
>     because for every call it consumes some kilobytes of RAM.
> 
>     I have red that it has to do with font caching.
> 
>     Now I am using DeleteObject(--font handle here---) after every release
>     of canvas (I have red somewhere else that it may solve the problem). It
>     seems that the memory leak does not appear but now this DeleteObject
>     makes my fonts display without formatting - as if I did not apply any
>     style, color or size on them.
> 
>     Does anyone know how to overcome this problem ?
> 
>     I am using UnDelphiX.
> 
>     Thanks in advance.
> 
>     ------------------------------
>     Are you using plain Windows API calls?
> 
>     there is a general rule that we must first save old canvas data,
>     change it's value, use the canvas, then restore old datas.
> 
>     var
>       hOld:HBRUSH;
>     begin
>       ... //get DC
>       hOld := SelectObject( hDC, hNewBrush );
>       ... //use DC
>       SelectObject( hDC, hOld );
>       ... //release DC
>     end;
> 
>     may be somewhere along the app, a func is using canvas data that has 
> already
>     been deleted, that won't happen if you always restore it's old value.
>     canvas's data such as font and brush defaulted to windows global objects
>     which is never freed.
> 
>     pardon my english,
>     FIreHAzaR:-D
>     West Java, Indonesia
> 
> 
>     ------------------------------------
> 
>     Yahoo! Groups Links
> 
> 
> 
> 
> 


Reply via email to