- TGraphic - C++ Builder
- C++ Builder 的字符串类型、字符类型、字符编码
- TInterfacedPersistent::AfterCons
- TInterfacedPersistent::QueryInte
- TInterfacedPersistent::~TInterfa
- TInterfacedPersistent::TInterfac
- TThread::NameThreadForDebugging
- TThread::Suspended - C++ Builder
- TThread::Terminate - C++ Builder
- TInterfacedObject - C++ Builder
C++ Builder 参考手册 ➙ Vcl::Graphics ➙ TGraphic
TGraphic 是所有 VCL 图片类的父类
- 简介
- 成员
属性
方法
事件
一. TGraphic 简介
- 继承关系:
System::TObject
⠀╙ System::Classes::TPersistent
⠀⠀⠀┗ System::Classes::TInterfacedPersistent
⠀⠀⠀⠀⠀└ Vcl::Graphics::TGraphic - 头文件:
#include <Vcl.Graphics.hpp>
- 命名空间:
Vcl::Graphics
- TGraphic 是所有 VCL 图片类的父类
二. TGraphic 成员
1. TGraphic 属性
属性 | 类型 | 说明 |
---|---|---|
public: | ||
Empty | bool | 如果不包含图像数据,此属性为 true |
Height | int | 图像的高度 (pixels) |
Modified | bool | 如果图像被修改过,此属性为 true |
Palette | HPALETTE | 调色板句柄 |
PaletteModified | bool | 如果调色板被修改过,此属性值为 true |
SupportsPartialTransparency | bool | 是否支持半透明或 Alpha 通道 |
Transparent | bool | 图像是否存在透明部分 |
Width | int | 图像的宽度 (pixels) |
2. TGraphic 方法
方法 | 说明 |
---|---|
public: | |
CanLoadFromStream | 检查流里面的数据是否符合这个图像格式 |
Equals | 比较图像是否和当前的图像相同 |
LoadFromClipboardFormat | 从剪贴板加载图像 |
LoadFromFile | 从文件加载图像 |
LoadFromStream | 从流加载图像 |
operator () | 类型转换操作符,转为 _di_IStreamPersist |
SaveToClipboardFormat | 把当前的图像数据转为剪贴板格式的数据, 可以把这些数据放入剪贴板 |
SaveToFile | 把当前图像保存到文件 |
SaveToStream | 把当前图像保存到流 |
SetSize | 修改图像的大小 (宽度, 高度) (pixels) |
TGraphic | 构造函数 |
~TGraphic | 析构函数 |
protected: | |
Changed | 当图像数据被修改的时候调用这个方法 |
DefineProperties | 把图像数据存入流中, 重载 TPersistent 的 DefineProperties |
Draw | 把当前图像数据显示到画布上 |
DrawTransparent | 把当前图像数据显示到画布上,半透明效果 |
Equals | 比较图像是否和当前图像相同 |
GetEmpty | 返回图像数据是否为空 |
GetHeight | 返回图像的高度 (pixels) |
GetPalette | 返回调色板句柄 |
GetSupportsPartialTransparency | 返回是否支持半透明或 Alpha 通道 |
GetTransparent | 返回图像是否存在透明部分 |
GetWidth | 返回图像的宽度 (pixels) |
Progress | 当图像改变时,会调用这个方法来触发 OnProgress 事件 |
ReadData | 从流里面读取图像数据 |
SetHeight | 改变图像高度 (pixels) |
SetPalette | 图像应用这个调色板 |
SetTransparent | 设为把图像显示为透明 / 不透明 |
SetWidth | 改变图像宽度 (pixels) |
WriteData | 把图像数据写到流里面 |
TInterfacedPersistent:: | 从 System::Classes::TInterfacedPersistent 继承过来的 |
public: | 从 System::Classes::TInterfacedPersistent 继承过来的 |
AfterConstruction | 在构造函数结束的时候自动调用 |
operator _di_IInterface | 类型转换操作符,转为 _di_IInterface 类型 |
QueryInterface | 返回当前组件所支持的 COM 接口的引用 |
TInterfacedPersistent | 构造函数 |
~TInterfacedPersistent | 析构函数 |
protected: | |
_AddRef | 调用 COM 接口增加引用计数 |
_Release | 调用 COM 接口减少引用计数 / 销毁对象 |
TPersistent:: | 从 System::Classes::TPersistent 继承过来的 |
public: | 从 System::Classes::TPersistent 继承过来的 |
Assign | 把 Source 对象的所有的属性和数据赋值到当前对象 |
GetNamePath | 返回在 Object Inspector 属性面板里面的名称 |
TPersistent | 构造函数 |
~TPersistent | 析构函数 |
protected: | |
AssignTo | 把当前对象的所有属性和数据都赋值到 Dest 对象 |
GetOwner | 返回对象的拥有者 |
TObject:: | 从 System::TObject 继承过来的 |
public: | 从 System::TObject 继承过来的 |
BeforeDestruction | 在执行析构函数之前自动调用 |
ClassInfo | 返回运行时类型信息表 (RTTI table) |
ClassName | 获取类名,不包含命名空间的类名字符串 |
ClassNameIs | 判断类名是否为参数指定的字符串 |
ClassParent | 返回父类的类型信息 |
ClassType | 返回类的类型信息 |
CleanupInstance | 清除长字符串、Variants、接口变量等 |
DefaultHandler | 默认的消息处理 |
Dispatch | 处理消息的函数 |
DisposeOf | 强制销毁对象 |
Equals | 比较当前对象和 Obj 对象是否相同 |
FieldAddress | 通过成员名称返回成员的地址 |
Free | 销毁对象 (Delphi) |
FreeInstance | 释放 NewInstance 分配的内存 |
GetInterface | 获取指定的接口 |
GetInterfaceEntry | 获取接口项目 |
GetInterfaceTable | 获取接口表 |
GetHashCode | 返回对象的 hash 值 |
InheritsFrom | 当前对象的类是否从 AClass 继承过来的 |
InitInstance | 初始化成员,给他们清零 |
InstanceSize | 返回给实例数据分配内存需要多少字节数 |
MethodAddress | 通过名称返方法的地址 |
MethodName | 通过方法的地址返回名称 |
NewInstance | 给实例分配内存,并且返回新的实例的地址 |
QualifiedClassName | 返回包含命名空间的类名 |
SafeCallException | 处理异常的函数 |
ToString | 转为字符串 |
UnitName | 返回类所在的命名空间 |
UnitScope | 返回类所在的命名空间 |
3. TGraphic 事件
事件 | 说明 |
---|---|
public: | |
OnChange | 当加载的图像发生变化时产生的事件 |
OnProgress | 图像在加载、存储、转换的过程中,会产生这个事件 |
参考:
- Vcl::Graphics::TPicture
- System::Classes::TInterfacedPersistent
- System::Classes::TPersistent
- System::TObject
- VCL 类继承关系
C++ Builder 参考手册 ➙ Vcl::Graphics ➙ TGraphic
网友评论