Exemplo n.º 1
0
 public Main(object _app)
 {
     InitializeComponent();
     app = (Corel.Interop.CorelDRAW.Application)_app;
     numCol.ValueChanged      += new RoutedPropertyChangedEventHandler <int>(cal_ValueChanged);
     numRow.ValueChanged      += new RoutedPropertyChangedEventHandler <int>(cal_ValueChanged);
     numSpace.ValueChanged    += new RoutedPropertyChangedEventHandler <int>(cal_ValueChanged);
     numInsert.ValueChanged   += new RoutedPropertyChangedEventHandler <float>(numInsert_ValueChanged);
     numFirstNum.ValueChanged += new RoutedPropertyChangedEventHandler <int>(calFistNum_ValueChanged);
     numLastNum.ValueChanged  += new RoutedPropertyChangedEventHandler <int>(calNum_ValueChanged);
     numColNum.ValueChanged   += new RoutedPropertyChangedEventHandler <int>(calNum_ValueChanged);
     numSpaceNum.ValueChanged += new RoutedPropertyChangedEventHandler <int>(calNum_ValueChanged);
     readTheme();
     //app.Application.SelectionChange += new DIVGApplicationEvents_SelectionChangeEventHandler(SelectionChanged);
 }
Exemplo n.º 2
0
        public Docker(object app)
        {
            InitializeComponent();

            cdrApp = (Corel.Interop.CorelDRAW.Application)app;

            //An example of wiring up evt listeners
            //
            //Note:
            //This will not work
            //cdrApp.SelectionChange += new Corel.Interop.VGCore.DIVGApplicationEvents_SelectionChangeEventHandler(cdrApp_SelectionChange);
            //cdrApp.SelectionChange += new Corel.Interop.CorelDRAW.DIVGApplicationEvents_SelectionChangeEventHandler(cdrApp_SelectionChange);
            //
            //Corel.Interop.VGCore.DIVGApplicationEvents_Event.SelectionChange conflicts with the Corel.Interop.CorelDRAW.DIVGApplicationEvents_Event.SelectionChange
            //so in order to wire up the listeners, need to cast the app to vgcore app
            ((Corel.Interop.VGCore.Application)cdrApp).SelectionChange += new Corel.Interop.VGCore.DIVGApplicationEvents_SelectionChangeEventHandler(cdrApp_SelectionChange);
        }
Exemplo n.º 3
0
 /// <summary>
 /// EMF转PLT
 /// </summary>
 /// <param name="emfPath">EMF位置</param>
 /// <param name="pltPath">PLT位置</param>
 public static void Emf2Plt(string emfPath, string pltPath)
 {
     Corel.Interop.CorelDRAW.Application coreldraw = new Corel.Interop.CorelDRAW.Application();
     coreldraw.OpenDocument(emfPath, 1);
     coreldraw.ActiveDocument.ExportBitmap(
         pltPath,
         Corel.Interop.VGCore.cdrFilter.cdrPLT,
         Corel.Interop.VGCore.cdrExportRange.cdrCurrentPage,
         Corel.Interop.VGCore.cdrImageType.cdrRGBColorImage,
         0, 0, 72, 72,
         Corel.Interop.VGCore.cdrAntiAliasingType.cdrNoAntiAliasing,
         false,
         true,
         true,
         false,
         Corel.Interop.VGCore.cdrCompressionType.cdrCompressionNone, null
         ).Finish();
     coreldraw.ActiveDocument.Close();
     coreldraw.Quit();
 }