Ejemplo n.º 1
0
        private void CreateBitmapLocal(int strSize = 221)
        {
            Layers layers = this.app.ActiveDocument.ActivePage.Layers;

            foreach (Layer l in layers)
            {
                if (l.Shapes.Count == 0 && !l.IsSpecialLayer)
                {
                    l.Delete();
                }
            }

            Layer tempLayer = this.app.ActiveDocument.ActivePage.CreateLayer("temp_qrcode");

            tempLayer.Activate();
            BitmapSource imageSource = (BitmapSource)img_render.Source;

            imageRender.SaveTempQrCodeFile(txt_content.Text, this.app.ActivePage.Resolution, strSize);
            StructImportOptions sio = new StructImportOptions();

            sio.MaintainLayers = true;

            ImportFilter importFilter = this.app.ActiveLayer.ImportEx(imageRender.QrCodeFilePath);

            importFilter.Finish();

            //Corel.Interop.VGCore.Clipboard cp = new Corel.Interop.VGCore.Clipboard();

            //System.Windows.Clipboard.SetImage(imageSource);
        }
Ejemplo n.º 2
0
        // ImportBackgrounds - Imports Backgrounds from Install Folder.

        private VGCore.Shape ImportBackground(String fileName)
        {
            String prefix = fileName.Substring(0, 3);

            StructImportOptions impOpt = this.appDraw.CreateStructImportOptions();

            if (prefix == "FMR")
            {
                ImportFilter impFil = this.appDraw.ActiveLayer.ImportEx("C:\\CorelDrawPreviewExport\\CorelDrawPreviewExport\\assets\\bg\\fmr\\" + fileName, cdrFilter.cdrCDR, impOpt);
                impFil.Finish();
            }
            else
            {
                ImportFilter impFil = this.appDraw.ActiveLayer.ImportEx("C:\\CorelDrawPreviewExport\\CorelDrawPreviewExport\\assets\\bg\\msmx\\" + fileName, cdrFilter.cdrCDR, impOpt);
                impFil.Finish();
            }

            return(this.appDraw.ActiveShape);
        }