當前位置: 首頁>>代碼示例>>C#>>正文


C# Color.CMYKAssign方法代碼示例

本文整理匯總了C#中System.Color.CMYKAssign方法的典型用法代碼示例。如果您正苦於以下問題:C# Color.CMYKAssign方法的具體用法?C# Color.CMYKAssign怎麽用?C# Color.CMYKAssign使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Color的用法示例。


在下文中一共展示了Color.CMYKAssign方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CreateMeasureRect

        bool CreateMeasureRect()
        {
            if (CDWin == null || CDWin.ActiveSelection == null || CDWin.ActiveSelection.Shapes.Count == 0 || CDWin.ActiveSelection.Shapes[1].Type != CorelDRAW.cdrShapeType.cdrBitmapShape)
            {
                MessageBox.Show("No Image selected. Select an Image first");
                return false;
            }
            CalMes = new CalibMeasure();

            CalMes.img = CDWin.ActiveSelection.Shapes[1];
            CalMes.mesRect = CDWin.ActiveLayer.CreateRectangle2(
                CDWin.ActiveWindow.ActiveView.OriginX,
                CDWin.ActiveWindow.ActiveView.OriginY,
                CDWin.ConvertUnits(3d, CorelDRAW.cdrUnit.cdrCentimeter, CDWin.ActiveDocument.Unit),
                CDWin.ConvertUnits(1d, CorelDRAW.cdrUnit.cdrCentimeter, CDWin.ActiveDocument.Unit)
                );

            Color back = new Color();
            back.CMYKAssign(0, 60, 100, 0);

            CalMes.mesRect.Selected = true;
            CalMes.mesRect.Outline.Width = 0;
            CalMes.mesRect.Fill.ApplyUniformFill(back);
            CalMes.mesRect.Transparency.ApplyUniformTransparency(0);
            CalMes.mesRect.Transparency.MergeMode = CorelDRAW.cdrMergeMode.cdrMergeXOR;

            return true;
        }
開發者ID:kleinsimon,項目名稱:SemTools4CD,代碼行數:28,代碼來源:SEMDock.xaml.cs

示例2: decorateShape

        private void decorateShape(semImage curShape)
        {
            ShapeRange SR = new ShapeRange();
            ShapeRange TextShapes = new ShapeRange();
            Shape Brect, Lrect, Wline, Ttext, Gr;
            double LmarginH, LmarginV, TmarginH, TmarginV, Theight;
            double Lwidth, Wwidth, Wheight, Lheight;
            double Left, Bottom, Width, Height;
            double oldCenterX, oldCenterY;
            double cimgratio;
            bool NoBar = false;
            Shape s = curShape.imgShape;
            semImageData d = curShape.imgData;
            double OffsetResolution = s.Bitmap.SizeWidth / s.SizeWidth;
            double bCut = 1d - d.CutBottom;
            Color White, Black;

            White = new Color();
            Black = new Color();
            Black.CMYKAssign(0, 0, 0, 100);
            White.CMYKAssign(0, 0, 0, 0);

            oldCenterX = s.CenterX;
            oldCenterY = s.CenterY;

            Left = s.LeftX;
            Bottom = s.BottomY;

            cimgratio = (s.SizeHeight * bCut) / s.SizeWidth;

            if (d.Width == 0d && d.Height == 0d)
            {
                Width = s.SizeWidth;
                Height = s.SizeHeight * bCut;
            }
            else if (d.Width == 0d)
            {
                Height = cmToUnit(d.Height);
                Width = Height / cimgratio;
            }
            else if (d.Height == 0d)
            {
                Width = cmToUnit(d.Width);
                Height = Width * cimgratio;
            }
            else
            {
                Width = cmToUnit(d.Width);
                Height = cmToUnit(d.Height);
            }
            double newRatio = Height / Width;

            if (newRatio <= cimgratio)
            {
                s.SizeWidth = Width;
                s.SizeHeight = (Width * cimgratio) / bCut;
            }
            else
            {
                s.SizeHeight = Height / bCut;
                s.SizeWidth = Height / cimgratio;
            }
            s.LeftX = Left;
            s.BottomY = Bottom;

            if (d.Mode == (int)CreateMode.Calib)
            {
                curShape.calcScale();
            }
            else if (d.Width == 0 || d.BarText == "")
            {
                NoBar = true;
            }

            Lwidth = cmToUnit(curShape.imgData.BarLength);

            Lheight = ptToUnit(8);
            LmarginH = ptToUnit(8);
            LmarginV = ptToUnit(4);
            TmarginH = ptToUnit(4);
            TmarginV = ptToUnit(4);

            Theight = ptToUnit(d.FontSize);
            Wwidth = Lwidth + 2 * LmarginH;
            Wheight = Lheight + LmarginV + TmarginV;

            Brect = CDWin.ActiveLayer.CreateRectangle2(Left, Bottom, Width, Height);
            Brect.Outline.Color = Black;
            Brect.Outline.Width = ptToUnit(d.BorderWidth);

            s.Name = "semItemContent";
            s.AlignToShape(CorelDRAW.cdrAlignType.cdrAlignTop, Brect);
            s.AddToPowerClip(Brect, CorelDRAW.cdrTriState.cdrFalse);

            if (d.ValInBar == true)
            {
                Wheight = Theight + 2 * TmarginV;
            }

            if (!NoBar)
//.........這裏部分代碼省略.........
開發者ID:kleinsimon,項目名稱:SemTools4CD,代碼行數:101,代碼來源:SEMDock.xaml.cs


注:本文中的System.Color.CMYKAssign方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。