摘要: type TARGBRect = packed record Blue, Green, Red, Alpha: Byte; end; var I, x, y: Integer; bmp: TGpBitmap; bg: TGpGraphics; Data: TBitmapData; P: PInteger; begin DoubleBuffered := True; bmp := TGpBitmap.Create('0.bmp'); try Data := bmp.LockBits(GpRect(0, 0, W, H), [imRead, imWr... 阅读全文
posted @ 2012-01-05 16:15 许明吉博客 阅读(4436) 评论(0) 推荐(1) 编辑
摘要: TGBBitmap用在GDI+中,而TBitmap用在GDI中,有的时候,我们需要将它们进行转换,例如我们要将一个JPEG的图片的缩略图放到TBitmap中,这样它就可以很方便的被Windows中的多个控件所使用(如ImageList、Image等等控件)。 程序用DELPHI实现,使用了for Delphi 的GDI+接口函数,GDI+部分的代码可能与网上的不同,但差别不大。 代码如下:use gdipapi,gdipobj,gdiputilprocedure TForm1.ToBitmap(fnames:string);VAR Graphics : TGPGraph... 阅读全文
posted @ 2012-01-05 13:36 许明吉博客 阅读(3052) 评论(0) 推荐(0) 编辑