Skip to content

从目录初始化OLA图像 - InitOlaImageFromDir

函数简介

从指定目录中加载图像文件,并将其初始化到OLA数据库中,可选择是否覆盖已存在的图像数据。

接口名称

InitOlaImageFromDir

DLL调用

cpp
int InitOlaImageFromDir(long ola, const long db, string dir, int cover);

参数说明

参数名类型说明
ola长整型数OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。
db长整型数数据库连接句柄,由 OpenDatabase 接口生成。
dir字符串图片目录路径。
cover布尔值是否覆盖已存在的图像数据,1 覆盖,0 跳过。

示例

SDK 调用

cpp
#include "OLAPlugServer.h"

OLAPlugServer ola;
int ret = ola.InitOlaImageFromDir(0, "value", 0);
csharp
using OLAPlug;

var ola = new OLAPlugServer();
int ret = ola.InitOlaImageFromDir(0, "value", 0);
python
from OLAPlugServer import OLAPlugServer

ola = OLAPlugServer()
ret = ola.InitOlaImageFromDir(0, "value", 0)
java
import com.olaplug.OLAPlugServer;

OLAPlugServer ola = new OLAPlugServer();
int ret = ola.InitOlaImageFromDir(0, "value", 0);
cpp
var ola = com("OlaPlug.OlaSoft")
var ret = ola.InitOlaImageFromDir(0, "value", 0)
vbscript
Set ola = CreateObject("OlaPlug.OlaSoft")
ret = ola.InitOlaImageFromDir(0, "value", 0)
text
.局部变量 ola, OLAPlug
ola.创建 ()
ret = ola.InitOlaImageFromDir(0, “value”, 0)
aardio
import OLAPlugServer;
var ola = OLAPlugServer();
var ret = ola.InitOlaImageFromDir(0, "value", 0);
text
变量 ola <类型 = OLAPlugServer>
ola = 新建 OLAPlugServer
整数 ret = ola.InitOlaImageFromDir(0, "value", 0)
cpp
#include "OLAPlugServer.h"

OLAPlugServer ola;
int32_t ret = ola.InitOlaImageFromDir(0, "value", 0);

原生 DLL 调用

cpp
long instance = CreateCOLAPlugInterFace();
InitOlaImageFromDir(instance, 0, "value", 0);
csharp
using System.Runtime.InteropServices;
using System.Text;

[DllImport("OLAPlug_x64.dll", CallingConvention = CallingConvention.StdCall)]
static extern long CreateCOLAPlugInterFace();
[DllImport("OLAPlug_x64.dll", CallingConvention = CallingConvention.StdCall)]
static extern int InitOlaImageFromDir(long ola, long db, string dir, int cover);

long instance = CreateCOLAPlugInterFace();
InitOlaImageFromDir(instance, 0, "value", 0);
python
from ctypes import CDLL, c_int, c_int64, create_string_buffer

ola = CDLL("OLAPlug_x64.dll")
ola.CreateCOLAPlugInterFace.restype = c_int64
instance = ola.CreateCOLAPlugInterFace()
ola.InitOlaImageFromDir(instance, 0, "value", 0)

返回值

返回值说明
1成功。
0失败。

注意事项

项目说明
批量导入图像数据的场景适用于批量导入图像数据的场景。
cover1 时覆盖现有数据cover1 时覆盖现有数据,为 0 时跳过已存在的图像。
如果初始化失败如果初始化失败,可通过 GetDatabaseError 获取详细错误信息。
路径确保目录路径正确且图像文件格式受支持,否则可能导致初始化失败。