旋转图片 - RotateImage
函数简介
将图片旋转指定的角度,支持任意角度旋转并自动调整输出图片大小。
接口名称
RotateImage
DLL调用
long RotateImage(long ola, long image_ptr, double angle);
参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| ola | 长整数型 | OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。 |
| image_ptr | 长整数型 | 要旋转的图片句柄 |
| angle | 双精度浮点数 | 旋转角度(度),正值顺时针,负值逆时针 |
示例
long image = LoadImage(ola, "D:\\test\\source.png");
if (image != 0) {
long rotated = RotateImage(ola, image, 90.0);
if (rotated != 0) {
SaveImageFromPtr(ola, rotated, "D:\\test\\rotated.png");
FreeImagePtr(ola, rotated);
}
FreeImagePtr(ola, image);
}
返回值
长整数型:成功返回新图片的句柄,失败返回0。
注意事项
- 旋转后返回新的图片句柄,原图片不会被修改。
- 返回的图片需调用 FreeImagePtr 释放内存。
