Board index » delphi » BrushCopy works in D1 but doesn't work in D3 !

BrushCopy works in D1 but doesn't work in D3 !

This code works under Delphi 1 but doesn't under Delphi3.02. How come?
Workaround? I just need to replace 1 color by the other:

<place a timage on your form and load a bitmap>

Image1.canvas.brush.color:=clYellow;
Image1.canvas.brushcopy(rect(0,0,32,32),Image1.Picture.Bitmap,
rect(0,0,32,32),clFuchsia);

 

Re:BrushCopy works in D1 but doesn't work in D3 !


I did some more testing..the first brushcopy works but the second not. It
gets white instead of yellow!! in Delphi 3.02

var  Bitmap: TBitmap;

begin

procedure TForm1.Button2Click(Sender: TObject);
var
  MyRect: TRect;
begin
  MyRect := Rect(10,10,100,100);

  with Form1.Canvas do begin
   Brush.color:=clYellow;
   BrushCopy(MyRect,Bitmap, MyRect, clFuchsia);
  end;

  with Image1.picture.bitmap.canvas do begin
   brush.color:=clYellow;
   brushcopy(myrect,Image1.Picture.Bitmap,myrect,clFuchsia);
  end;

end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Bitmap := TBitmap.Create;

Bitmap.LoadFromFile('Y:\Malmberg\Pluspunt\def\Thema1\Construc\mp431110.bmp')
;
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
  Bitmap.Free;
end;

Quote
Jan Oonk wrote in message <714kq7$9t...@newnews.nl.uu.net>...
>This code works under Delphi 1 but doesn't under Delphi3.02. How come?
>Workaround? I just need to replace 1 color by the other:

><place a timage on your form and load a bitmap>

>Image1.canvas.brush.color:=clYellow;
>Image1.canvas.brushcopy(rect(0,0,32,32),Image1.Picture.Bitmap,
>rect(0,0,32,32),clFuchsia);

Other Threads