移除OLA图像 - RemoveOlaImage
函数简介
从OLA数据库中移除指定目录和文件名的单个图像数据。
接口名称
RemoveOlaImage
DLL调用
int RemoveOlaImage(long ola, const long db, string dir, string fileName);
参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| ola | 长整型数 | OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成 |
| db | 长整型数 | 数据库连接句柄,由 OpenDatabase 接口生成 |
| dir | 字符串 | 图像文件在数据库中的目录路径 |
| fileName | 字符串 | 图像文件名 |
示例
C#
// 移除OLA图像
string imageDir = "C:/images";
string fileName = "image.png";
int result = OLAServer.RemoveOlaImage(db, imageDir, fileName);
if (result == 1)
{
Console.WriteLine("OLA图像移除成功。");
}
Python
# 移除OLA图像
imageDir = "C:/images"
fileName = "image.png"
result = OLAServer.RemoveOlaImage(db, imageDir, fileName)
if result == 1:
print("OLA图像移除成功。")
返回值
操作结果。成功返回 1,失败返回 0。
注意事项
- 适用于删除单个图像数据的场景。
- 如果移除失败,可通过 GetDatabaseError 获取详细错误信息。
- 确保目录路径和文件名正确且图像数据存在于数据库中。
