Results 1 to 1 of 1

Thread: Print Screen

  1. #1
    gabrielg50
    gabrielg50 is offline
    Guest
    Join Date
    2013 Sep
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Print Screen

    procedure TForm1.Button1Click(Sender: TObject);
    var
    dc:HDC;
    jpg:TJPEGImage;
    bmp:TBitmap;
    begin

    try
    {TJPEGImage necessario declara unit JPeg na delcaração uses...}

    jpg:=TJPEGImage.Create;

    bmp:=TBitmap.Create;

    {Monitor e uma class i esta disponivel como
    property delcarado em TCustomForm e guarada
    informações sobre a sobre a configuração de resoluca como largura e altura}

    bmp.Width:=Monitor.Width;
    bmp.Height:=Monitor.Height;

    {usando a função da Api Windows getdc com valor zero , voce recuprea o descriptor do desktop do windows}

    dc:=GetDC(0);

    {usando a função BitBlt da Api windows para gravar o descriptor da tela no canvas do Bitmap capiturando a Tela}

    BitBlt(bmp.Canvas.Handle,0,0,bmp.Width,bmp.Height, dc,0,0,SRCCOPY);


    jpg.CompressionQuality:=100;

    { convertendo bitmap para Jpg qualidade
    exelente como acima 100% e de tamanho bem menor que o bitmap}

    jpg.Assign(bmp);

    jpg.SaveToFile('c:Teste.jpg');


    finally
    DeleteDC(dc);
    bmp.Free;
    jpg.Free;
    end;
    end;

Similar Threads

  1. [Help] Black Screen
    By joeySW in forum Dragon Nest
    Replies: 2
    Last Post: 2014-10-22, 09:30 AM
  2. GTA 5's Direct Screen Comparison on Xbox 360 & PS3
    By 1048jack11 in forum General Programming
    Replies: 0
    Last Post: 2013-09-18, 08:34 AM
  3. [Info] Screen Bug
    By thunderwave in forum Aika Guides, Tutorials
    Replies: 4
    Last Post: 2013-04-18, 02:22 AM
  4. [Request] How convert model FAK in OBJ ? [Request With screen]
    By texhion in forum Game Files
    Replies: 1
    Last Post: 2012-09-12, 09:00 PM
  5. [Help] How to play with less lag, with many people on the screen
    By TheCheff in forum Aika Guides, Tutorials
    Replies: 2
    Last Post: 2012-01-25, 02:51 PM
Visitors found this page by searching for:
Nobody landed on this page from a search engine, yet!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •