View Issue Details

IDProjectCategoryView StatusLast Update
0008047LazarusLCLpublic2012-02-04 20:19
ReporterMarco van de VoortAssigned ToFelipe Monteiro de Carvalho 
PrioritynormalSeverityfeatureReproducibilityalways
Status resolvedResolutionfixed 
Product VersionProduct Build 
Target VersionFixed in Version0.9.31 (SVN) 
Summary0008047: canvas.brushcopy not found.
Descriptioncanvas.brushcopy not found while porting:

Canvas.BrushCopy (Rect(0, 0, Width, Height), FBkg,
          Rect(0, 0, Width, Height), FBkg.Canvas.Pixels[0, Height-1] or $02000000);
TagsNo tags attached.
Fixed in Revision35134
LazTarget1.0
WidgetsetWin32/Win64
Attached Files

Relationships

has duplicate 0010710 closedBart Broersma TCanvas lacks BrushCopy; Lazreport isn't compilable anymore 

Activities

Vincent Snijders

2006-12-31 16:45

manager   ~0010593

Information about the desired functionality would be appreciated.

Phil

2007-01-04 23:13

reporter   ~0010657

Here's Delphi's help on BrushCopy:

"Copies a portion of a bitmap onto a rectangle on the canvas, replacing one of the colors of the bitmap with the brush of the canvas."

I needed BrushCopy for the port of Orpheus. Initially I just called the StretchDraw method instead. Now I'm using this standalone function, passing in the canvas as the first param.

procedure BrushCopy(DestCanvas: TCanvas; const Dest: TRect; Bitmap: TBitmap;
                    const Source: TRect; Color: TColor);
begin
  StretchBlt(DestCanvas.Handle, Dest.Left, Dest.Top,
             Dest.Right - Dest.Left, Dest.Bottom - Dest.Top,
             Bitmap.Canvas.Handle, Source.Left, Source.Top,
             Source.Right - Source.Left, Source.Bottom - Source.Top, SrcCopy);
end;

This works better, although I don't know what to do with the Color param. I think it's used to make the copied image partially transparent.

In the Orpheus ovcmisc unit, there are some useful-looking routines that might be useful for this transparency effect, for example, TransStretchBlt and DrawTransparentBitmap. They're not documented very well so I'm not sure yet how they work or what they do, but you might look at them for ideas for implementing BrushCopy:

http://web.fastermac.net/~MacPgmr/OrphPort/OrphStatus.html

Zeljan Rikalo

2011-11-11 08:03

developer   ~0053996

Target 1.0 , to keep api delphi compat.

Zeljan Rikalo

2012-02-04 12:12

developer   ~0056341

@Felipe please see what to do with this. This is needed to be Delphi compatibile.
a) Use proposal from Phil (I'm already using it, of course without Color param )
b) Postpone

Felipe Monteiro de Carvalho

2012-02-04 19:47

developer   ~0056486

I wrote my own code to implement it which does the full job, tested in Carbon.

Zeljan Rikalo

2012-02-04 20:19

developer   ~0056488

Welldone Felipe :)

Issue History

Date Modified Username Field Change
2006-12-31 16:38 Marco van de Voort New Issue
2006-12-31 16:38 Marco van de Voort LazTarget => -
2006-12-31 16:38 Marco van de Voort Widgetset => Win32
2006-12-31 16:45 Vincent Snijders LazTarget - => post 1.0
2006-12-31 16:45 Vincent Snijders Note Added: 0010593
2006-12-31 16:45 Vincent Snijders Status new => acknowledged
2006-12-31 16:45 Vincent Snijders Severity minor => feature
2007-01-04 23:13 Phil Note Added: 0010657
2008-09-16 16:26 Vincent Snijders Relationship added has duplicate 0010710
2011-11-11 08:03 Zeljan Rikalo LazTarget post 1.0 => 1.0
2011-11-11 08:03 Zeljan Rikalo Note Added: 0053996
2012-02-04 12:12 Zeljan Rikalo Note Added: 0056341
2012-02-04 12:12 Zeljan Rikalo Assigned To => Felipe Monteiro de Carvalho
2012-02-04 12:12 Zeljan Rikalo Status acknowledged => assigned
2012-02-04 19:47 Felipe Monteiro de Carvalho Fixed in Revision => 35134
2012-02-04 19:47 Felipe Monteiro de Carvalho Status assigned => resolved
2012-02-04 19:47 Felipe Monteiro de Carvalho Fixed in Version => 0.9.31 (SVN)
2012-02-04 19:47 Felipe Monteiro de Carvalho Resolution open => fixed
2012-02-04 19:47 Felipe Monteiro de Carvalho Note Added: 0056486
2012-02-04 20:19 Zeljan Rikalo Note Added: 0056488