天天看点

Delphi 的绘图功能[14] - 图像类

delphi 的绘图功能[14] - 图像类

delphi 的 graphic 单元有五个重要的图像类: tgraphic、tbitmap、tmetafile、ticon、tpicture.

tbitmap 用来操作位图;

tmetafile 用来操作图元文件;

ticon 用来操作图标(包括鼠标指针)文件;

tbitmap、tmetafile、ticon 都是 tgraphic 的子类, 由于

tcanvas.draw(x, y: integer; graphic: tgraphic); 的第三个参数就是 tgraphic 类型,

所以它们都可以通过 tcanvas.draw 输出.

如果三种图像都要容得下, 就得用 tpicture 类, 它即包含 bitmap、metafile、icon 对象属性, 也包含 graphic 对象属性; timage 类呢又包含 picture 属性, 所以可以用 timage 显示所以这些图像格式.

这其中, 我最喜欢的类当属 tbitmap, 因为它相当于一个内存画板, 双倍缓存就得用它.

posted on 2008-02-18 21:03  万一  阅读(5617)  评论(0)  编辑  收藏

继续阅读