当前位置: 首页>>代码示例>>C#>>正文


C# ProjectLayoutElement.GetElementBorderColor方法代码示例

本文整理汇总了C#中CardMaker.XML.ProjectLayoutElement.GetElementBorderColor方法的典型用法代码示例。如果您正苦于以下问题:C# ProjectLayoutElement.GetElementBorderColor方法的具体用法?C# ProjectLayoutElement.GetElementBorderColor怎么用?C# ProjectLayoutElement.GetElementBorderColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CardMaker.XML.ProjectLayoutElement的用法示例。


在下文中一共展示了ProjectLayoutElement.GetElementBorderColor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DrawElement

        public static void DrawElement(Graphics zGraphics, Deck zDeck, ProjectLayoutElement zElement, ElementType eType, int nX, int nY, string sInput)
        {
            switch (eType)
            {
                case ElementType.Graphic:
                case ElementType.Shape:
                    sInput = sInput.Trim();
                    break;
            }

            Font zFont = null;
            Brush zBrush = null;
            Pen zBorderPen = null;

            Color colorFont = Color.Black;

            if (0 != zElement.borderthickness)
            {
                zBorderPen = 255 != zElement.opacity
                    ? new Pen(Color.FromArgb(zElement.opacity, zElement.GetElementBorderColor()), zElement.borderthickness)
                    : new Pen(zElement.GetElementBorderColor(), zElement.borderthickness);
            }

            // Setup
            switch (eType)
            {
                case ElementType.Text:
                case ElementType.FormattedText:
                    zFont = zElement.GetElementFont();
                    colorFont = zElement.GetElementColor();
                    zBrush = new SolidBrush(colorFont);
                    break;
                case ElementType.Graphic:
                case ElementType.Shape:
                    break;
                default:
                    return;
            }

            // NOTE: this is the first transform
            if (0 != zElement.rotation)
            {
                // center the internal element then rotate and restore
                zGraphics.TranslateTransform(zElement.x + nX + (zElement.width >> 1), zElement.y + nY + (zElement.height >> 1));
                zGraphics.RotateTransform(zElement.rotation);
                zGraphics.TranslateTransform(-(zElement.width >> 1), -(zElement.height >> 1));
            }
            else
            {
                zGraphics.TranslateTransform(zElement.x + nX, zElement.y + nY);
            }
            // TODO: an interface for all these would be more appropriate

            // Draw
            switch (eType)
            {
                case ElementType.Text:
                    DrawText(zGraphics, zElement, sInput, zBrush, zFont, colorFont);
                    break;
                case ElementType.FormattedText:
                    DrawFormattedText(zGraphics, zDeck, zElement, sInput, zBrush, zFont, colorFont);
                    break;
                case ElementType.Graphic:
                    DrawGraphic(zGraphics, sInput, zElement);
                    break;
                case ElementType.Shape:
                    ShapeManager.HandleShapeRender(zGraphics, sInput.ToLower(), zElement);
                    break;
            }

            if (null != zBorderPen)
            {
                // note that the border is inclusive in the width/height consuming 2 pixels (0 to total-1)
                zGraphics.DrawRectangle(zBorderPen, 0,0,zElement.width - 1, zElement.height - 1);
            }

            zGraphics.ResetTransform();
        }
开发者ID:NotNemesis,项目名称:cardmaker,代码行数:78,代码来源:DrawItem.cs

示例2: UpdatePanelColors

 private void UpdatePanelColors(ProjectLayoutElement zElement)
 {
     if (zElement != ElementManager.Instance.GetSelectedElement())
     {
         return;
     }
     panelBorderColor.BackColor = zElement.GetElementBorderColor();
     panelOutlineColor.BackColor = zElement.GetElementOutlineColor();
     panelShapeColor.BackColor = zElement.GetElementColor();
     panelFontColor.BackColor = panelShapeColor.BackColor;
 }
开发者ID:ksuquix,项目名称:cardmaker,代码行数:11,代码来源:MDIElementControl.cs

示例3: UpdatePanelColors

 private void UpdatePanelColors(ProjectLayoutElement zElement)
 {
     if (zElement != MDILayoutControl.Instance.GetSelectedLayoutElement()) return;
     panelBorderColor.BackColor = zElement.GetElementBorderColor();
     panelOutlineColor.BackColor = zElement.GetElementOutlineColor();
     panelShapeColor.BackColor = zElement.GetElementColor();
     panelFontColor.BackColor = panelShapeColor.BackColor;
 }
开发者ID:NotNemesis,项目名称:cardmaker,代码行数:8,代码来源:MDIElementControl.cs


注:本文中的CardMaker.XML.ProjectLayoutElement.GetElementBorderColor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。