Custom component

vosvos
edited 2:49PM in FastReport 4.0
I try to create a custom component inherited from TfrxView with a 2D barcode bitmap (TBitmap) in it.
How do I paint the barcode bitmap on the canvas in the Draw procedure?
Currently I have this:
procedure TfrxDataMatrixBarcode.Draw(Canvas: TCanvas; ScaleX, ScaleY, OffsetX,
  OffsetY: Extended);
begin
  if FNeedUpdate then
  begin
    UpdateBarcodeBitmap;
    FNeedUpdate := False;
  end;
  BeginDraw(Canvas, ScaleX, ScaleY, OffsetX, OffsetY);
  DrawBackground;
  //How to draw a TBitmap here?
  DrawFrame;
end;

Because it is a 2D barcode, I want the bitmap not strechted and only scale with the ScaleX and ScaleY values. Otherwise the barcode will get corrupted.

Can somebody help me with this?

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.