نمایش نتایج 1 تا 40 از 435

نام تاپیک: نکات برنامه نویسی در دلفی

Threaded View

پست قبلی پست قبلی   پست بعدی پست بعدی
  1. #8

    Screen Shots

    Screen Shots
    با استفاده از این کد میتوانید تصویر Screen را در یک فایل Bitmap ذخیره نمائید. اگر نمیخواهید از یک برنامه فعال دلفی استفاده کنید میتوانید یک 'Application.Minimize;' در Beginning پروسیجر وارد کنید.




    uses
    Windows, Graphics, Forms;

    procedure TForm1.Button1Click(Sender: TObject);
    var
    DC: HDC;
    Canvas: TCanvas;
    MyBitmap: TBitmap;
    begin
    Canvas := TCanvas.Create;
    MyBitmap := TBitmap.Create;
    DC := GetDC(0);

    try
    Canvas.Handle := DC;
    with Screen do
    begin
    {/ detect the actual height and with of the screen /}
    MyBitmap.Width := Width;
    MyBitmap.Height := Height;

    {/ copy the screen content to the bitmap /}
    MyBitmap.Canvas.CopyRect(Rect(0, 0, Width, Height), Canvas,
    Rect(0, 0, Width, Height));
    {/ stream the bitmap to disk /}
    MyBitmap.SaveToFile('c:\windows\desktop\sc reen.bmp');
    end;

    finally
    {/ free memory /}
    ReleaseDC(0, DC);
    MyBitmap.Free;
    Canvas.Free
    end;
    end;
    آخرین ویرایش به وسیله بهروز عباسی : چهارشنبه 09 مرداد 1392 در 15:53 عصر

برچسب های این تاپیک

قوانین ایجاد تاپیک در تالار

  • شما نمی توانید تاپیک جدید ایجاد کنید
  • شما نمی توانید به تاپیک ها پاسخ دهید
  • شما نمی توانید ضمیمه ارسال کنید
  • شما نمی توانید پاسخ هایتان را ویرایش کنید
  •