On Fri, 24 Nov 2006 11:01:51 +0100
"Patrick Chevalley" <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> I start to play with you new stretchdraw,  this work fine with today
> Lazarus snapshot.
> I quickly hack TCanvas.StretchDraw to use it and I am pleased with
> the first result as this solve the ugly stretchdraw we have
> previously on Win32. See the attached image that show the result,new
> stretchdraw on right :) , this is a TImage with Stretch property to
> true.
> 
> This is how I change TCanvas.StretchDraw, any idea to avoid this
> multiple conversion from TGraphic to TBitmap to TFPCustomImage ?
> 
> procedure TCanvas.StretchDraw(const DestRect: TRect; SrcGraphic:
> TGraphic); var img: TLazIntfImage;
>     bmp: TBitmap;
> begin
>   if not Assigned(SrcGraphic) then exit;
>   Changing;
>   RequiredState([csHandleValid]);
> //  SrcGraphic.Draw(Self, DestRect);
> // added for FPCanvas.Strechdraw
>   bmp:=TBitmap.Create;
>   bmp.Assign(SrcGraphic);
>   img:=bmp.CreateIntfImage;
>   Inherited StretchDraw(DestRect.Left,DestRect.Top,
>                DestRect.Right-DestRect.Left,DestRect.Bottom-DestRect.Top
> ,img);
>   img.free;
>   bmp.free;
> //
>   Changed;
> end;

Improve StretchMaskBlt instead.

Mattias

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to