mxcad 1.0.374 → 1.0.375

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/mxcad.d.ts CHANGED
@@ -12944,6 +12944,27 @@ export declare class McObject {
12944
12944
  * ```
12945
12945
  */
12946
12946
  loadImage(imageUrl: string, call: (image: any) => void, imageFileName?: string, fileType?: string): void;
12947
+ /**
12948
+ * 加载Base64图片。
12949
+ * @param imageUrl 图片路径
12950
+ * @param call 回调函数
12951
+ * @example
12952
+ * ```ts
12953
+ import { MxCpp, McObject } from "mxcad"
12954
+ const mxcad: McObject = MxCpp.getCurrentMxCAD()
12955
+ mxcad.loadImage(imagUrl, (image) => {
12956
+ if (!image) {
12957
+ console.log("loadImage failed");
12958
+ return;
12959
+ }
12960
+ let width = mxcad.mxdraw.viewCoordLong2Cad(100);
12961
+ let height = (image.height / image.width) * width;
12962
+ idImage = mxcad.drawImage((pt as any).x, (pt as any).y, width, height, 0, imagUrl,true);
12963
+ mxcad.updateDisplay();
12964
+ });
12965
+ * ```
12966
+ */
12967
+ loadImageBase64(sImageBase64: string, imageFileName: string, call: (image: any) => void): void;
12947
12968
  /**
12948
12969
  * 绘制一个图片
12949
12970
  * @param dPosX 图片 X 坐标
@@ -13360,6 +13381,10 @@ export declare class McObject {
13360
13381
  * 得到当前布局ID
13361
13382
  */
13362
13383
  getCurrentLayoutId(): McObjectId;
13384
+ /**
13385
+ * 得到当前openWebFile打开的文件,的文件名,如果打开是一个流数据,该变量会取服务器返回请求头的filename的值。
13386
+ */
13387
+ GetDocumentFileName(): string;
13363
13388
  /**
13364
13389
  * 返加MxCpp对象,它会在MxDraw模块中调用。
13365
13390
  */
package/dist/mxcad.es.js CHANGED
@@ -15080,7 +15080,7 @@ win.McDrawObjectEvent_asciiToUTF8 = function (hexstr) {
15080
15080
  return MxG2312Obj.decodeFromGb2312Imp(hexstr);
15081
15081
  };
15082
15082
 
15083
- const version$1 = "1.0.373";
15083
+ const version$1 = "1.0.374";
15084
15084
 
15085
15085
  var isSharedArrayBuffer = "SharedArrayBuffer" in window;
15086
15086
  var isCdn = document.currentScript && /unpkg\.com\/mxcad/.test(document.currentScript.src);
@@ -23291,6 +23291,11 @@ var McObject = /*#__PURE__*/function () {
23291
23291
  var fileType = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "";
23292
23292
  this.imp["mxdrawObject"].getMxObjectImplement().loadMxCADImage(imageUrl, call, imageFileName, fileType);
23293
23293
  }
23294
+ }, {
23295
+ key: "loadImageBase64",
23296
+ value: function loadImageBase64(sImageBase64, imageFileName, call) {
23297
+ this.imp["mxdrawObject"].getMxObjectImplement().loadMxCADImageBase64(sImageBase64, imageFileName, call);
23298
+ }
23294
23299
  }, {
23295
23300
  key: "drawImage",
23296
23301
  value: function drawImage(dPosX, dPosY, dWidth, dHeight, dAng, imageName) {
@@ -23515,6 +23520,11 @@ var McObject = /*#__PURE__*/function () {
23515
23520
  value: function getCurrentLayoutId() {
23516
23521
  return new McObjectId(this.imp.GetCurrentLayout());
23517
23522
  }
23523
+ }, {
23524
+ key: "GetDocumentFileName",
23525
+ value: function GetDocumentFileName() {
23526
+ return MxG2312Obj.decodeFromGb2312(this.imp.GetDocumentFileName());
23527
+ }
23518
23528
  }, {
23519
23529
  key: "getMxCpp",
23520
23530
  value: function getMxCpp() {