Transparent work now
Posted: 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;
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;