Вниз
Скачать: CL | DM;

Экран в рисунок   Найти похожие ветки 

← →
PARUS ©   (2006-02-04 18:01) [0]

Как в image1 Поставить рисунок :то что в экране.
(не используя PRT SC SYS RQ)


← →
atruhin ©   (2006-02-04 18:06) [1]

GetDC(0)


← →
kaZaNoVa ©   (2006-02-04 18:06) [2]

program Project1;

uses
Windows,SysUtils, Graphics,jpeg;

 function ScreenWidth:Integer;
begin
 Result := GetSystemMetrics(SM_CXSCREEN);
end;
function ScreenHeight:Integer;
begin
 Result := GetSystemMetrics(SM_CYSCREEN);
end;

Var
bmp1: TBitmap; jpg2:TJpegImage;FileName:String;
ScreenDC:HDC;

begin
if ParamCount<1 then
begin
FileName:=Paramstr(0);
delete(FileName,Length(FileName)-3,4);
FileName:=FileName+".jpg"
end else
FileName:=Paramstr(1);

bmp1 := TBitmap.Create;
jpg2 :=  TJpegImage.Create;
bmp1.Height := ScreenHeight;
bmp1.Width  := ScreenWidth;

ScreenDC:=GetDC(GetDesktopWindow);

BitBlt(bmp1.Canvas.Handle, 0, 0, ScreenWidth, ScreenHeight, ScreenDC , 0, 0, SRCCopy);
jpg2.Assign(bmp1);
if ParamCount<>2 then
jpg2.CompressionQuality:=57 else
jpg2.CompressionQuality:=StrToInt(Paramstr(2));

jpg2.Compress;
jpg2.SaveToFile(FileName);
bmp1.Free;  jpg2.Free;
ReleaseDC(0,ScreenDC);

end.



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.031 c
1-1138116612
pasha_golub
2006-01-24 18:30
2006.02.26
Рисование растра в метафайл


2-1139604019
Ntalka
2006-02-10 23:40
2006.02.26
Простой класс


2-1139503424
Silver...
2006-02-09 19:43
2006.02.26
$I чтоб по всему Проекту видно было


2-1139492489
Heap
2006-02-09 16:41
2006.02.26
Heap


3-1135759898
tytus
2005-12-28 11:51
2006.02.26
Dinamic SQL error -206




   Наверх