截图 怎么把一个放在image上的位图进行截图,即把某部分区域复制给另一个位图bitmap 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 可以参考下http://www.cnblogs.com/del/archive/2010/04/25/1719631.html procedure TForm12.btn1Click(Sender: TObject);var Bitmap: TBitmap; DstRect, SrcRect: TRect;begin if self.image1.Picture.Bitmap.Empty then exit; Bitmap := TBitmap.Create; //给Bitmap赋值: Bitmap.Assign(image1.Picture.Graphic); //要截取的区域:SrcRect:=Rect(Round(Image1.Picture.Width/image1.Width*(shp1.Left-image1.Left)), Round(Image1.Picture.Height/image1.Height*(shp1.top-Image1.top)), Round(Image1.Picture.Width/image1.Width*shp1.Width)+Round(Image1.Picture.Width/image1.Width*(shp1.Left-image1.Left)), Round(Image1.Picture.Height/image1.Height*(shp1.Height))+Round(Image1.Picture.Height/image1.Height*(shp1.top-Image1.top))); DstRect := SrcRect; OffsetRect(DstRect, -DstRect.Left, -DstRect.Top); //确定img1的位图大小: img1.Picture.Bitmap.Width :=Round(Image1.Picture.Width/image1.Width*shp1.Width); img1.Picture.Bitmap.Height :=Round(Image1.Picture.Height/image1.Height*shp1.Height); //截取图片到img1: img1.Canvas.CopyRect(DstRect, Bitmap.Canvas, SrcRect); Bitmap.Free;end;这里是用一个矩形Shape1来选择截取区域的 delphi 调用配置了SSL的C#开发的WebServices时. 关于播放FLASH文件问题 有关数据备份的 关于Easytable的求助 知道传奇3.0的的进来,我有服务器端的BCB代码 请各们大虾们,看看这条‘没错’的程序那里出错? Delphi DLL 中传递Pchar 参数的问题,请大侠们帮忙 近来看一下 在控件Canvas上画的图形如何让它居中显示? 哪位朋友有专门输浮点数的控件啊? Delphi中查看Paradox表结构类型 delphi 2010 里的TRibbon 怎么不能放Edit控件啊,不会用,请高手指点!
http://www.cnblogs.com/del/archive/2010/04/25/1719631.html
procedure TForm12.btn1Click(Sender: TObject);
var
Bitmap: TBitmap;
DstRect, SrcRect: TRect;begin
if self.image1.Picture.Bitmap.Empty then exit;
Bitmap := TBitmap.Create;
//给Bitmap赋值:
Bitmap.Assign(image1.Picture.Graphic); //要截取的区域:
SrcRect:=Rect(Round(Image1.Picture.Width/image1.Width*(shp1.Left-image1.Left)),
Round(Image1.Picture.Height/image1.Height*(shp1.top-Image1.top)),
Round(Image1.Picture.Width/image1.Width*shp1.Width)+Round(Image1.Picture.Width/image1.Width*(shp1.Left-image1.Left)),
Round(Image1.Picture.Height/image1.Height*(shp1.Height))+Round(Image1.Picture.Height/image1.Height*(shp1.top-Image1.top)));
DstRect := SrcRect;
OffsetRect(DstRect, -DstRect.Left, -DstRect.Top);
//确定img1的位图大小:
img1.Picture.Bitmap.Width :=Round(Image1.Picture.Width/image1.Width*shp1.Width);
img1.Picture.Bitmap.Height :=Round(Image1.Picture.Height/image1.Height*shp1.Height);
//截取图片到img1:
img1.Canvas.CopyRect(DstRect, Bitmap.Canvas, SrcRect);
Bitmap.Free;
end;这里是用一个矩形Shape1来选择截取区域的