Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/VCLX/TCanvas    [ Add a report in this area ]  
Report #:  6732   Status: Reported
TCanvas.StretchDraw ignores CopyMode in CLX
Project:  Delphi Build #:  1
Version:    7.0 Submitted By:   Richard Winston
Report Type:  Basic functionality failure Date Reported:  12/31/2003 3:36:34 PM
Severity:    Commonly encountered problem Last Updated: 12/31/2003 3:35:44 PM
Platform:    All platforms Internal Tracking #:  
Resolution: None  Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: (1 Total Rating)
5.00 out of 5
Total Votes: None
Description
None
Steps to Reproduce:
Use the following procedure to try to combine two bitmaps (in Sources) into a single bitmap (Destination.)  (See attached project.)

procedure CombineBitMaps(const Sources : array of TBitmap;
  const Destination : TBitMap; const TransparentColor : TColor); overload;
var
  SourceIndex : integer;
  ABitMap : TBitmap;
  ARect : TRect;
  Rect2: TRect;
begin
  ARect.Left := 0;
  ARect.Top := 0;
  ARect.Right := Destination.Width-1 ;
  ARect.Bottom := Destination.Height-1 ;
  Rect2 := ARect;
  Rect2.Right := Rect2.Right div 2;

  Destination.Canvas.Brush.Color := TransparentColor;
  Destination.Canvas.FillRect(ARect);

  for SourceIndex := 0 to Length(Sources) -1 do
  begin
    ABitMap := Sources[SourceIndex];
    ABitMap.TransparentColor := TransparentColor;
    Destination.Canvas.StretchDraw(ARect,ABitMap);  // doesn't work
//    Destination.Canvas.Draw(0,0,ABitMap); // works
//    Destination.Canvas.CopyRect(Rect2, ABitMap.Canvas, ARect); // doesn't work
  end;
  Destination.TransparentColor := TransparentColor;
end;
Workarounds
None
Attachment
Bitmaptest.zip
Comments

None

Server Response from: ETNACODE01