Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem drawing a bitmap on a canvas

Status
Not open for further replies.

Stretchwickster

Programmer
Apr 30, 2001
1,746
GB
The following code should in theory draw the clipBitmap on APrintCanvas but doesn't. I have checked that clipBitmap does actually contain the right image. However, I think the problem might be that I'm passing the canvas of an image from another form (form2), into a method (belonging to form1) as APrintCanvas. Anyone got any ideas on how to sort this out?

Code:
  clipBitmap := TBitmap.Create;
  try
    memoryChart1.CopyToClipboardBitmap;
    if Clipboard.HasFormat(CF_BITMAP) then
    begin
      clipBitmap.LoadFromClipboardFormat(CF_BITMAP, Clipboard.GetAsHandle(CF_BITMAP), 0);
      APrintCanvas.Draw(0, 0, clipBitmap);
    end;
  finally
    clipBitmap.Free;
  end;
Clive [infinity]
 
Problem solved...I was passing in a TImage canvas from a QReport when I should have been passing a TQRImage canvas! Clive [infinity]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top