Graphics.TBitmap和QGraphics.TBitmap有何不同?

magicmouse 2003-08-16 04:42:52
写了一段程序,在编译时出现Graphics.TBitmap和QGraphics.TBitmap类型不兼容错误,两者有何不同?如何处理? 加前缀Q的单元代表什么意思?
...全文
55 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
magicmouse 2003-08-16
  • 打赏
  • 举报
回复
原来是在uses子句中写错了单元,呜
zhoutian618 2003-08-16
  • 打赏
  • 举报
回复
应该是一样的结构。
不过前面加Q的单元是在LINUX中的KYLIX中用的。

加Q的单元是指所谓的CLX架构的控件。
Graphics32 Graphics32 is a library designed for fast 32-bit graphics handling on Delphi, Kylix and Lazarus. Optimized for 32-bit pixel formats, it provides fast operations with pixels and graphic primitives, and in most cases Graphics32 outperforms the standard TCanvas classes. It is almost a hundred times faster in per-pixel access and about 2–5 times faster in drawing lines. Features Some of Graphics32 features include: Fast per-pixel access up to 100 times faster compared to standard TBitmap; High-performance Bitmap alpha blending (including per-pixel alpha blending); Pixel, line and polygon antialiasing with sub-pixel accuracy (combined with alpha blending); Arbitrary polygon transformations and custom fillings; Bitmap resampling with high quality reconstruction filters (e.g. Lanczos, Cubic, Mitchell); A unique state-of-the-art rasterization system; Affine transformations of bitmaps: rotations, scaling, etc with sub-pixel accuracy; Arbitrary projective transformations of bitmaps; Arbitrary remapping transformations of bitmaps (e.g. for Warping, Morphing); Flexible supersampling implementation for maximum sampling quality; Flicker-free image displaying components with optimized double buffering via advanced MicroTiles? based repaint optimizer; Multiple customizible easy-to-use overlay layers; Locking of bitmaps for safe multithreading; A property editor for RGB and alpha channel loading; Design-time loading of image formats supported by standard TPicture; Works on Embarcadero RAD Studio, Delphi, C++ Builder and Kylix (The last version that supported Kylix was 1.8.3). Also Lazarus is supported. As of version 1.5.1b Graphics32 is licensed under the terms of the Mozilla Public License.
procedure BitmapFileToPNG(const Source, Dest: String); var Bitmap: TBitmap; PNG: TPNGObject; begin Bitmap := TBitmap.Create; PNG := TPNGObject.Create; {In case something goes wrong, free booth Bitmap and PNG} try Bitmap.LoadFromFile(Source); PNG.Assign(Bitmap); //Convert data into png PNG.SaveToFile(Dest); finally Bitmap.Free; PNG.Free; end end; Converting from PNG file to Windows bitmap file The above inverse. Loads a png and saves into a bitmap procedure PNGFileToBitmap(const Source, Dest: String); var Bitmap: TBitmap; PNG: TPNGObject; begin PNG := TPNGObject.Create; Bitmap := TBitmap.Create; {In case something goes wrong, free booth PNG and Bitmap} try PNG.LoadFromFile(Source); Bitmap.Assign(PNG); //Convert data into bitmap Bitmap.SaveToFile(Dest); finally PNG.Free; Bitmap.Free; end end; Converting from TImage to PNG file This method converts from TImage to PNG. It has full exception handling and allows converting from file formats other than TBitmap (since they allow assigning to a TBitmap) procedure TImageToPNG(Source: TImage; const Dest: String); var PNG: TPNGObject; BMP: TBitmap; begin PNG := TPNGObject.Create; {In case something goes wrong, free PNG} try //If the TImage contains a TBitmap, just assign from it if Source.Picture.Graphic is TBitmap then PNG.Assign(TBitmap(Source.Picture.Graphic)) //Convert bitmap data into png else begin //Otherwise try to assign first to a TBimap BMP := TBitmap.Create; try BMP.Assign(Source.Picture.Graphic); PNG.Assign(BMP); finally BMP.Free; end; end; //Save to PNG format PNG.SaveToFile(Dest); finally PNG.Free; end end;

1,183

社区成员

发帖
与我相关
我的任务
社区描述
Delphi GAME,图形处理/多媒体
社区管理员
  • GAME,图形处理/多媒体社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧