Board index » delphi » Form to Clipboard as a Graphic?

Form to Clipboard as a Graphic?

I know its possible, but how can you send an entire form to the clipboard
as an image?

tia,

Roy.
r...@mechnet.liv.ac.uk

 

Re:Form to Clipboard as a Graphic?


On Thu, 13 Jan 2000 16:05:30 -0000 Roy Coates wrote:

Quote
> I know its possible, but how can you send an entire form to the clipboard
> as an image?

I have a procedure to copy the whole screen to clipboard. You can easily
modify it to reduce it to the form's bounds.

procedure Screen2Clipboard;
var
  clp: TClipboard;
  DC: THandle;
  BM: graphics.TBitmap;
  h, w: integer;
begin
  h:= Screen.Height;
  w:= Screen.Width;
  clp:= TClipboard.Create;
  BM:= graphics.TBitmap.Create;
  BM.Height:= h;
  BM.Width:= w;
  clp.Clear;
  DC:= CreateDC('DISPLAY', nil, nil, nil);
  BitBlt(BM.Canvas.Handle, 0, 0, w, h, DC, 0, 0, srccopy);
  clp.Assign(BM);
  BM.Free;
  DeleteDC(DC);
  clp.Free;
end;

Bye, Udo

Re:Form to Clipboard as a Graphic?


My sincerest thanks :)

Roy.

Quote
Udo Nesshoever <newsgroup.re...@gmx.net> wrote in message

news:rhmt7ssn8qhbtmun8rlp2ujpqolms6lo8c@4ax.com...
Quote
> On Thu, 13 Jan 2000 16:05:30 -0000 Roy Coates wrote:

> > I know its possible, but how can you send an entire form to the
clipboard
> > as an image?

> I have a procedure to copy the whole screen to clipboard. You can easily
> modify it to reduce it to the form's bounds.

> procedure Screen2Clipboard;
> var
>   clp: TClipboard;
>   DC: THandle;
>   BM: graphics.TBitmap;
>   h, w: integer;
> begin
>   h:= Screen.Height;
>   w:= Screen.Width;
>   clp:= TClipboard.Create;
>   BM:= graphics.TBitmap.Create;
>   BM.Height:= h;
>   BM.Width:= w;
>   clp.Clear;
>   DC:= CreateDC('DISPLAY', nil, nil, nil);
>   BitBlt(BM.Canvas.Handle, 0, 0, w, h, DC, 0, 0, srccopy);
>   clp.Assign(BM);
>   BM.Free;
>   DeleteDC(DC);
>   clp.Free;
> end;

> Bye, Udo

Re:Form to Clipboard as a Graphic?


On Thu, 20 Jan 2000 13:22:23 -0000 Roy Coates wrote:

Quote
> My sincerest thanks :)

Glad I could help ya.

Bye, Udo

Other Threads