Ver Mensaje Individual
  #2  
Antiguo 16-09-2007
l30 l30 is offline
Miembro
 
Registrado: jun 2007
Posts: 36
Reputación: 0
l30 Va por buen camino
Bueno no se si esto te sirva fide, allí te va.

Código Delphi [-]
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
     procedure foto_pantalla(Image: TBitmap);
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.foto_pantalla(Image: TBitmap);
var
  DC : HDC;
begin
  DC := GetDC (GetDesktopWindow);

  try
    Image.Width := GetDeviceCaps (DC, HORZRES);
    Image.Height := GetDeviceCaps (DC, VERTRES);
    BitBlt(Image.Canvas.Handle, 0, 0, Image.Width,
    Image.Height,DC, 0, 0, SRCCOPY);
  finally
    ReleaseDC (GetDesktopWindow, DC);
  end;

end;

procedure TForm1.Button1Click(Sender: TObject);
var
   Image_m: Timage;
begin
   Image_m:= TImage.Create(Self);
   foto_pantalla(Image_m.Picture.Bitmap);
   Image_m.Picture.SaveToFile('imagen.bmp');
   Image_m.Free;
end;

end.
Responder Con Cita