Esempio n. 1
0
        public DockerUI(corel.Application app)
        {
            this.corelApp = app;
            InitializeComponent();

            boost = new Boost(app);

            //default

            colorRemapUserColor.CMYKAssign(0, 0, 0, 0);
            colorToUserColor.CMYKAssign(0, 0, 0, 100);
            UpdateColorBar();

            cbRemap.SelectedIndex               = 0;
            cbRemapColorType.SelectedIndex      = 0;
            cbRemapColorSpaceType.SelectedIndex = 0;
            cbRemapColorRangeType.SelectedIndex = 0;

            cbTo.SelectedIndex = 0;
            cbToColorSpaceType.SelectedIndex = 0;

            cbApplyRange.SelectedIndex = 0;

            chbApplyFill.IsChecked    = true;
            chbApplyOutline.IsChecked = true;

            for (int i = 0; i < fountainColorTint.Count(); i++)
            {
                fountainColorTint[i] = corelApp.CreateCMYKColor(0, 0, 0, i);
            }

            pantonePalettes = new XmlPaletteService(corelApp).LoadPalettes();
            lbPantonePalette.ItemsSource = pantonePalettes;
            lbPantonePalette.SelectAll();
        }
Esempio n. 2
0
        private void CreateVetorLocal2()
        {
            CreateBitmapLocal();
            Shapes shapes = this.app.ActiveLayer.Shapes;

            foreach (Corel.Interop.VGCore.Shape shape in shapes)
            {
                if (shape.Name == "temp_qrcode.jpg")
                {
                    double x, y, w, h;
                    shape.GetPosition(out x, out y);
                    shape.GetSize(out w, out h);

                    TraceSettings traceSettings = shape.Bitmap.Trace(cdrTraceType.cdrTraceLineDrawing);
                    traceSettings.DetailLevelPercent    = 100;
                    traceSettings.BackgroundRemovalMode = cdrTraceBackgroundMode.cdrTraceBackgroundAutomatic;
                    traceSettings.CornerSmoothness      = 0;
                    traceSettings.DeleteOriginalObject  = true;
                    traceSettings.RemoveBackground      = true;
                    traceSettings.RemoveEntireBackColor = true;
                    traceSettings.RemoveOverlap         = true;
                    traceSettings.SetColorCount(2);
                    traceSettings.SetColorMode(cdrColorType.cdrColorGray, cdrPaletteID.cdrCustom);
                    traceSettings.Smoothing = 0;
                    traceSettings.TraceType = cdrTraceType.cdrTraceClipart;
                    traceSettings.Finish();
                    Corel.Interop.VGCore.ShapeRange sr = new Corel.Interop.VGCore.ShapeRange();
                    foreach (Corel.Interop.VGCore.Shape s in this.app.ActiveLayer.Shapes)
                    {
                        sr.Add(s);
                    }
                    sr.CreateSelection();
                    Corel.Interop.VGCore.Shape qrShape = this.app.ActiveSelection;
                    Corel.Interop.VGCore.Shape cod     = this.app.ActiveSelection.Weld(qrShape);
                    cod.Name = "Cod";

                    Corel.Interop.VGCore.Color cWhite = new Corel.Interop.VGCore.Color();
                    cWhite.CMYKAssign(0, 0, 0, 0);
                    Corel.Interop.VGCore.Shape border = this.app.ActiveLayer.CreateRectangle2(x, y - h, w, h);
                    border.Fill.ApplyUniformFill(cWhite);
                    border.Outline.Width = 0;
                    border.OrderToBack();
                    border.Name = "Borda";
                    int strSize = 221;



                    cod.AddToSelection();
                    border.AddToSelection();
                    Corel.Interop.VGCore.Shape g = this.app.ActiveSelection.Group();
                    this.app.ActiveDocument.Unit = this.app.ActiveDocument.Rulers.HUnits;
                    if (Int32.TryParse(txt_size.Text, out strSize))
                    {
                        g.SetSize(strSize, strSize);
                    }
                    else
                    {
                        System.Windows.MessageBox.Show("Formato de tamanho inválido", "Aviso para Você!");
                    }
                }
            }
            this.app.ActiveLayer.Name = "QrCode Vetor";
        }