I've just added the following method to one of my components:

procedure TMapField.CopyToClipboard;
var
  tempBitmap: TBitmap;
begin
  tempBitmap := TBitmap.Create;
  tempBitmap.Width := Width;
  tempBitmap.Height := Height;
  PaintOnCanvas(tempBitmap.Canvas); // Custom drawing routine
  Clipboard.Assign(tempBitmap);
  tempBitmap.Free;
end;

However, when ever this method gets called, my app crashes, returns to
delphi and brings up the CPU monitor thingy with an error in NTDLL.DLL.

I have noticed that the clipboard -does- contain the image, so I'm
guessing something is going bad when I free tempBitmap, should I be doing
something different?

Mark


-- 
Mark Derricutt                     | Chalice of Blood
Software Developer                 | New Zealand Christian Music News
Auckland, New Zealand              | http://www.chalice.gen.nz
[EMAIL PROTECTED]                | UIN: 1934853

Getting jiggy with Mike Portnoy - Portnoys Dream

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to