Transparent work now

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
alex
Newbie
Newbie
Posts: 7
Joined: Fri Aug 18, 2006 12:00 am

Transparent work now

Post by alex » Tue Jul 08, 2008 12:55 pm

I rewrote procedure


869705892583681


Procedure TTeeCanvas.AssignBrushColor(ABrush:TChartBrush; AColor,ABackColor:TColor);
var
i,j,k:integer;
bmp:tbitmap;
begin
if Monochrome then AColor:=clWhite;
if integer(ABrush.Style)>7 then begin ////127 standart brushes
i:=integer(ABrush.Style)-8;
j:=integer(Brush.Style)-8;
if i<>j then begin
brush.Style:=bsclear;
Brush.Bitmap:=nil;
Brush.Style:=tbrushstyle(i);
bmp:=tbitmap.create;
GetTeeBrush(i, bmp);
bmp.Monochrome:=true;
bmp.Transparent:=true;
bmp.TransparentColor:=clwhite;
brush.Bitmap:=bmp;
end;
SetTextColor(Handle,ColorToRGB(AColor));

BackMode:=cbmtransparent;
backcolor:=ABackColor;
if abackcolor=transpcol then SetROP2(Handle, R2_MASKPEN);

if i<>j then bmp.free;
exit;
end;
if Assigned(ABrush.FImage) and Assigned(ABrush.FImage.Graphic) then
begin
Brush.Style:=bsClear;
Brush.Bitmap:=ABrush.Image.Bitmap;

{$IFDEF TEEWINDOWS}
SetTextColor(Handle,ColorToRGB(AColor));
{$ENDIF}

BackMode:=cbmOpaque;
BackColor:=ABackColor;
end
else
begin
Brush.Bitmap:=nil;

if AColor<>Brush.Color then { 5.02 }
Brush.Color:=AColor;
if ABrush.Style<>Brush.Style then { 5.02 }
Brush.Style:=ABrush.Style;
if ABackColor=transpcol then BackMode:=cbmTransparent { 5.02 }
else
begin
BackMode:=cbmOpaque;
BackColor:=ABackColor;
end;
end;
end;

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Jul 08, 2008 1:02 pm

Hi alex,

Would you be so kind to send us a simple example project we can run "as-is" to reproduce the bug this code fixes?

You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply