Skip to content

导出字库数据 - ExportDict

函数简介

将OLA数据库中的图像数据导出到指定目录。

接口名称

ExportDict

DLL调用

int ExportDict(long ola, long db, string dict_name, string exportDir);

参数说明

参数名类型说明
ola长整数型OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。
db长整数型数据库连接句柄,由 OpenDatabase 接口生成。
dict_name字符串字库名称。
exportDir字符串导出路径。

示例

SDK 调用

cpp
#include "OLAPlugServer.h"

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

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

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

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

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

原生 DLL 调用

cpp
long instance = CreateCOLAPlugInterFace();
ExportDict(instance, 0, "num", "value");
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 ExportDict(long ola, long db, string dict_name, string exportDir);

long instance = CreateCOLAPlugInterFace();
ExportDict(instance, 0, "num", "value");
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.ExportDict(instance, 0, "num", "value")

返回值

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

注意事项

项目说明
适用于批量导出字库图像数据的场景适用于批量导出字库图像数据的场景。
如果导出失败如果导出失败,可以通过 GetDatabaseError 函数获取详细的错误信息。
路径确保目录路径正确,且图像数据存在于数据库中。
导出的图像文件将保存在 exportDir导出的图像文件将保存在 exportDir 指定的目录中,确保目标目录有足够的存储空间。