F
flycity001
Unregistered / Unconfirmed
GUEST, unregistred user!
[]1、在Delphi中除了将图片压缩成JPEG,还有没有其它的压缩方法更好的(比JPEG更小,或是品质更高)。
2、怎么复位图像的指针。像在流中一样,有一个Position=0可以复位。在Tbitmap 或 是在Tjpegimage中要怎么做呢?
比如说我抓取的屏幕,得到了一个位图句柄。。。
源码:
width:=screen.Width;
height:=screen.Height;
sourcedc:=createdc('display','','',nil);
destdc:=createcompatibledc(sourcedc);
bhandle:=createcompatiblebitmap(sourcedc,Width,height);
selectobject(destdc,bhandle);
bitblt(destdc,0,0,width,height,sourcedc,0,0,SRCCOPY);//抓取的屏幕
map:=tbitmap.Create;
map.Handle:=bhandle;
map.savetofile('c:/wy/screen.bmp');//
map.LoadFromFile('c:/wy/screen.bmp');//如果去了这两句就不能显示出图片了。
form1.Canvas.Draw(0,0,map);
2、怎么复位图像的指针。像在流中一样,有一个Position=0可以复位。在Tbitmap 或 是在Tjpegimage中要怎么做呢?
比如说我抓取的屏幕,得到了一个位图句柄。。。
源码:
width:=screen.Width;
height:=screen.Height;
sourcedc:=createdc('display','','',nil);
destdc:=createcompatibledc(sourcedc);
bhandle:=createcompatiblebitmap(sourcedc,Width,height);
selectobject(destdc,bhandle);
bitblt(destdc,0,0,width,height,sourcedc,0,0,SRCCOPY);//抓取的屏幕
map:=tbitmap.Create;
map.Handle:=bhandle;
map.savetofile('c:/wy/screen.bmp');//
map.LoadFromFile('c:/wy/screen.bmp');//如果去了这两句就不能显示出图片了。
form1.Canvas.Draw(0,0,map);