Hi,

On 9/2/06, Giuliano Colla <[EMAIL PROTECTED]> wrote:
The TBitmap.Draw method bluntly ignores the Canvas CopyMode, and forces
a fixed SRCCOPY.

I noticed because I have a nice TGauge component (derived from old
Delphi examples) which uses cmBlackness and cmSrcInvert to provide a
transparency effect, and which was getting painted just as a black box.


I have noticed the same thing, and also derived it from the Kylix code
which I bought.  Due to licensing, I scrapped the code, and rewrote
the whole thing, without looking at Kylix code again, so licensing
shouldn't be a problem with mine.

I can share/contribute the code if anybody is interrested.  It
currently does a Horizontal progress (with percentage shown as text)
and a Dial (speedo meter) gauge.

Regards,
 - Graeme -







The funny thing is that with Kylix 1 it was giving the same result, but
because of a totally different error. It was fixed in Kylix 3.

The attached patch fixes the problem. It shouldn't break anything else,
because the default for canvas CopyMode property is SRCCOPY.

Note. I would gladly contribute the component, but I'm unsure about the
licensing issue. I feel entitled to use it, because I've purchased it
with Delphi, and it's not my fault if Borland dropped Kylix support.


Index: bitmap.inc
===================================================================
--- bitmap.inc  (revisione 9781)
+++ bitmap.inc  (copia locale)
@@ -118,7 +118,7 @@
     StretchMaskBlt(DestDC,
             DestRect.Left,DestRect.Top,
             DestRect.Right-DestRect.Left,DestRect.Bottom-DestRect.Top,
-            SrcDC,0,0,Width,Height, UseMaskHandle,0,0,SRCCOPY);
+            SrcDC,0,0,Width,Height, UseMaskHandle,0,0,DestCanvas.CopyMode);
     DestCanvas.Changed;
   end;
 end;





--
There's no place like 127.0.0.1

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

Reply via email to