获取图片大小 - GetImageSize
函数简介
获取指定图片的宽度和高度,返回的尺寸单位为像素。
接口名称
GetImageSize
DLL调用
int GetImageSize(long ola, long image_ptr, int* width, int* height);
参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| ola | 长整数型 | OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。 |
| image_ptr | 长整数型 | 图片句柄 |
| width | 整数型指针 | 返回图片的宽度(像素) |
| height | 整数型指针 | 返回图片的高度(像素) |
示例
long image = LoadImage(ola, "D:\\test\\sample.png");
if (image != 0) {
int width, height;
int ret = GetImageSize(ola, image, &width, &height);
if (ret == 1) {
printf("图片大小:%d x %d\n", width, height);
}
FreeImagePtr(ola, image);
}
返回值
整数型:1 成功,0 失败。
