BVB Source Codes

PDF file browser Show GraphicsProperties.cs Source code

Return Download PDF file browser: download GraphicsProperties.cs Source code - Download PDF file browser Source code - Type:.cs
  1. using System;
  2. using System.Globalization;
  3. using System.Drawing;
  4. using System.Xml.Serialization;
  5. using PdfSharp.Drawing;
  6.  
  7. namespace XDrawing.TestLab
  8. {
  9.   /// <summary>
  10.   ///
  11.   /// </summary>
  12.   [XmlRootAttribute("GraphicsProperties", Namespace="http://www.pdfsharp.com", IsNullable = false)]
  13.   public class GraphicsProperties
  14.   {
  15.     public GraphicsProperties()
  16.     {
  17.       this.general = new GeneralProperties();
  18.       this.general.BackColor.Color = XColor.FromArgb(255, 253, 253);
  19.  
  20.       this.pen1 = new PenProperty();
  21.       this.pen1.Color.Color = XColors.Black;
  22.       this.pen1.Width = 1;
  23.  
  24.       this.pen2 = new PenProperty();
  25.       this.pen2.Color.Color = XColors.Red;
  26.       this.pen2.Width = 3;
  27.  
  28.       this.pen3 = new PenProperty();
  29.       this.pen3.Color.Color = XColors.Green;
  30.       this.pen3.Width = 5;
  31.  
  32.       this.brush1 = new BrushProperty();
  33.       this.brush1.Color.Color = XColors.DarkBlue;
  34.  
  35.       this.brush2 = new BrushProperty();
  36.       this.brush2.Color.Color = XColors.Orange;
  37.  
  38.       this.brush3 = new BrushProperty();
  39.       this.brush3.Color.Color = XColors.Yellow;
  40.  
  41.       this.font1 = new FontProperty();
  42.       this.font1.FamilyName = "Verdana";
  43.       this.font1.Color.Color = XColors.Black;
  44.       this.font1.Size = 15;
  45.       this.font1.Text = "ABCgfw";
  46.  
  47.       this.font2 = new FontProperty();
  48.       this.font2.FamilyName = "Times New Roman";
  49.       this.font2.Color.Color = XColors.Red;
  50.       this.font2.Size = 10;
  51.       this.font2.Bold = true;
  52.       this.font2.Text = "Qwerty";
  53.  
  54.       this.font3 = new FontProperty();
  55.       this.font3.FamilyName = "Courier New";
  56.       this.font3.Color.Color = XColors.SpringGreen;
  57.       this.font3.Size = 15;
  58.       this.font3.Bold = true;
  59.       this.font3.Italic = true;
  60.       this.font3.Text = "Qwerty";
  61.     }
  62.  
  63.     public bool AutoApply = true;
  64.  
  65.     public System.Drawing.Rectangle rect = new Rectangle(0, 1, 2, 3);
  66.  
  67.     public GeneralProperties General
  68.     {
  69.       get {return this.general;}
  70.       set {this.general = value;}
  71.     }
  72.     GeneralProperties general;
  73.  
  74.     public PenProperty Pen1
  75.     {
  76.       get {return this.pen1;}
  77.       set {this.pen1 = value;}
  78.     }
  79.     PenProperty pen1;
  80.  
  81.     public PenProperty Pen2
  82.     {
  83.       get {return this.pen2;}
  84.       set {this.pen2 = value;}
  85.     }
  86.     PenProperty pen2;
  87.  
  88.     public PenProperty Pen3
  89.     {
  90.       get {return this.pen3;}
  91.       set {this.pen3 = value;}
  92.     }
  93.     PenProperty pen3;
  94.  
  95.     public BrushProperty Brush1
  96.     {
  97.       get {return this.brush1;}
  98.       set {this.brush1 = value;}
  99.     }
  100.     BrushProperty brush1;
  101.  
  102.     public BrushProperty Brush2
  103.     {
  104.       get {return this.brush2;}
  105.       set {this.brush2 = value;}
  106.     }
  107.     BrushProperty brush2;
  108.  
  109.     public BrushProperty Brush3
  110.     {
  111.       get {return this.brush3;}
  112.       set {this.brush3 = value;}
  113.     }
  114.     BrushProperty brush3;
  115.  
  116.     public FontProperty Font1
  117.     {
  118.       get {return this.font1;}
  119.       set {this.font1 = value;}
  120.     }
  121.     FontProperty font1;
  122.  
  123.     public FontProperty Font2
  124.     {
  125.       get {return this.font2;}
  126.       set {this.font2 = value;}
  127.     }
  128.     FontProperty font2;
  129.  
  130.     public FontProperty Font3
  131.     {
  132.       get {return this.font3;}
  133.       set {this.font3 = value;}
  134.     }
  135.     FontProperty font3;
  136.   }
  137.  
  138.   public class GeneralProperties
  139.   {
  140.     public GeneralProperties()
  141.     {
  142.       this.backColor = new ColorProperty();
  143.       this.backColor.Color = XColors.Ivory;
  144.       this.tension = 0.5;
  145.     }
  146.  
  147.     public ColorProperty BackColor
  148.     {
  149.       get {return this.backColor;}
  150.       set {this.backColor = value;}
  151.     }
  152.     ColorProperty backColor;
  153.  
  154.     public XFillMode FillMode
  155.     {
  156.       get {return this.fillMode;}
  157.       set {this.fillMode = value;}
  158.     }
  159.     XFillMode fillMode;
  160.  
  161.     public double Tension
  162.     {
  163.       get {return this.tension;}
  164.       set {this.tension = value;}
  165.     }
  166.     double tension;
  167.   }
  168.  
  169.   public class ColorProperty
  170.   {
  171.     public ColorProperty()
  172.     {
  173.       this.color = XColors.Transparent;
  174.     }
  175.  
  176.     [XmlIgnore]
  177.     public XColor Color
  178.     {
  179.       get {return this.color;}
  180.       set {this.color = value;}
  181.     }
  182.     XColor color;
  183.  
  184.     [XmlIgnore]
  185.     public double A
  186.     {
  187.       get {return this.color.A;}
  188.       set {this.color.A = value;}
  189.     }
  190.  
  191.     [XmlIgnore]
  192.     public byte R
  193.     {
  194.       get {return this.color.R;}
  195.       set {this.color.R = value;}
  196.     }
  197.  
  198.     [XmlIgnore]
  199.     public byte G
  200.     {
  201.       get {return this.color.G;}
  202.       set {this.color.G = value;}
  203.     }
  204.  
  205.     [XmlIgnore]
  206.     public byte B
  207.     {
  208.       get {return this.color.B;}
  209.       set {this.color.B = value;}
  210.     }
  211.  
  212.     [XmlIgnore]
  213.     public double C
  214.     {
  215.       get {return this.color.C;}
  216.       set {this.color.C = value;}
  217.     }
  218.  
  219.     [XmlIgnore]
  220.     public double M
  221.     {
  222.       get {return this.color.M;}
  223.       set {this.color.M = value;}
  224.     }
  225.  
  226.     [XmlIgnore]
  227.     public double Y
  228.     {
  229.       get {return this.color.Y;}
  230.       set {this.color.Y = value;}
  231.     }
  232.  
  233.     [XmlIgnore]
  234.     public double K
  235.     {
  236.       get {return this.color.K;}
  237.       set {this.color.K = value;}
  238.     }
  239.  
  240.     [XmlIgnore]
  241.     public double GS
  242.     {
  243.       get {return this.color.GS;}
  244.       set {this.color.GS = value;}
  245.     }
  246.  
  247.     /// <summary>
  248.     /// Special property for XmlSerializer only.
  249.     /// </summary>
  250.     [XmlAttribute("color")]
  251.     public string rgbcmykgs
  252.     {
  253.       get {return this.color.RgbCmykG;}
  254.       set {this.color.RgbCmykG = value;}
  255.     }
  256.   }
  257.  
  258.   public class PenProperty
  259.   {
  260.     public PenProperty()
  261.     {
  262.       this.color = new ColorProperty();
  263.       this.color.Color = XColors.OliveDrab;
  264.       this.width = 1;
  265.     }
  266.  
  267.     [XmlIgnore]
  268.     public XPen Pen
  269.     {
  270.       get
  271.       {
  272.         if (this.pen == null)
  273.           this.pen = new XPen(this.color.Color, this.Width);
  274.         else //if (this.dirty)
  275.         {
  276.           this.pen.Color = this.color.Color;
  277.           this.pen.Width = this.Width;
  278.           this.pen.DashStyle = this.DashStyle;
  279.           this.pen.LineCap = this.LineCap;
  280.           this.pen.LineJoin = this.LineJoin;
  281.           //this.dirty = false;
  282.         }
  283.         return this.pen;
  284.       }
  285.     }
  286.     //bool dirty = true;
  287.     XPen pen;
  288.  
  289.     public ColorProperty Color
  290.     {
  291.       get {return this.color;}
  292.       set {this.color = value;}
  293.     }
  294.     ColorProperty color;
  295.  
  296.     [XmlAttribute]
  297.     public float Width
  298.     {
  299.       get {return this.width;}
  300.       set {this.width = value;}
  301.     }
  302.     float width;
  303.  
  304.     [XmlAttribute]
  305.     public XDashStyle DashStyle
  306.     {
  307.       get {return this.dashStyle;}
  308.       set {this.dashStyle = value;}
  309.     }
  310.     internal XDashStyle dashStyle;
  311.  
  312.     [XmlAttribute]
  313.     public XLineCap LineCap
  314.     {
  315.       get {return this.lineCap;}
  316.       set {this.lineCap = value;}
  317.     }
  318.     internal XLineCap lineCap;
  319.  
  320.     [XmlAttribute]
  321.     public XLineJoin LineJoin
  322.     {
  323.       get {return this.lineJoin;}
  324.       set {this.lineJoin = value;}
  325.     }
  326.     internal XLineJoin lineJoin;
  327.   }
  328.  
  329.   public class BrushProperty
  330.   {
  331.     public BrushProperty()
  332.     {
  333.       this.color = new ColorProperty();
  334.       this.color.Color = XColors.GreenYellow;
  335.     }
  336.  
  337.     [XmlIgnore]
  338.     public XSolidBrush Brush
  339.     {
  340.       get
  341.       {
  342.         if (this.brush == null)
  343.           this.brush = new XSolidBrush(this.color.Color);
  344.         else //if (this.dirty)
  345.         {
  346.           this.brush.Color = this.color.Color;
  347.           //this.dirty = false;
  348.         }
  349.         return this.brush;
  350.       }
  351.     }
  352.     //bool dirty = true;
  353.     XSolidBrush brush;
  354.  
  355.     public ColorProperty Color
  356.     {
  357.       get {return this.color;}
  358.       set {this.color = value;}
  359.     }
  360.     ColorProperty color;
  361.   }
  362.  
  363.   public class FontProperty
  364.   {
  365.     public FontProperty()
  366.     {
  367.       this.color = new ColorProperty();
  368.       this.color.Color = XColors.DarkBlue;
  369.       this.familyName = "Verdana";
  370.     }
  371.  
  372.     [XmlIgnore]
  373.     public XFont Font
  374.     {
  375.       get
  376.       {
  377.         this.font = new XFont(this.familyName, this.size, Style);
  378.         //else //if (this.dirty)
  379.         //{
  380.         //  this.font.Color = this.color.Color;
  381.         //  this.font.Size = this.size;
  382.         //  this.font.Bold = this.bold;
  383.         //  this.font.Italic = this.italic;
  384.         //  //this.dirty = false;
  385.         //}
  386.         return this.font;
  387.       }
  388.     }
  389.     //bool dirty = true;
  390.     XFont font;
  391.  
  392.     [XmlIgnore]
  393.     public XFontStyle Style
  394.     {
  395.       get {return (Bold ? XFontStyle.Bold : XFontStyle.Regular) | (Italic ? XFontStyle.Italic : XFontStyle.Regular);}
  396.     }
  397.  
  398.     [XmlIgnore]
  399.     public XSolidBrush Brush
  400.     {
  401.       get
  402.       {
  403.         if (this.brush == null)
  404.           this.brush = new XSolidBrush(this.color.Color);
  405.         else //if (this.dirty)
  406.         {
  407.           this.brush.Color = this.color.Color;
  408.           //this.dirty = false;
  409.         }
  410.         return this.brush;
  411.       }
  412.     }
  413.     //bool dirty = true;
  414.     XSolidBrush brush;
  415.  
  416.     public ColorProperty Color
  417.     {
  418.       get {return this.color;}
  419.       set {this.color = value;}
  420.     }
  421.     ColorProperty color;
  422.  
  423.     public string FamilyName
  424.     {
  425.       get {return this.familyName;}
  426.       set {this.familyName = value;}
  427.     }
  428.     string familyName;
  429.  
  430.     public float Size
  431.     {
  432.       get {return this.size;}
  433.       set {this.size = value;}
  434.     }
  435.     float size;
  436.  
  437.     public bool Bold
  438.     {
  439.       get {return this.bold;}
  440.       set {this.bold = value;}
  441.     }
  442.     bool bold;
  443.  
  444.     public bool Italic
  445.     {
  446.       get {return this.italic;}
  447.       set {this.italic = value;}
  448.     }
  449.     bool italic;
  450.  
  451.     public string Text
  452.     {
  453.       get {return this.text;}
  454.       set {this.text = value;}
  455.     }
  456.     string text;
  457.   }
  458. }
  459.  
downloadGraphicsProperties.cs Source code - Download PDF file browser Source code
Related Source Codes/Software:
Campus id - This system includes a campus dormitory management... 2015-04-10
ShopXP online system source code - ShopXP ShoppingNet online system source code infor... 2015-04-10
TOM cat demo in learning to speak - 实现汤米猫学说话的演示,即实现变声功能鲜豔,,,,,,,开发者说:自己经常来看code4app,看看... 2015-04-10
Another OpenFolder - Implements can commence in the middle of the scree... 2015-04-10
Bus query system - A simple bus query system. Can be divided into rou... 2015-04-10
Customer service management system - To a store and development of customer service man... 2015-04-10
OA office automation system - OA office automation system is tomorrow technology... 2015-04-10
Chapters novel divider (ChapCuttor) - Chapter divider (ChapCuttor) by & have spent Black... 2015-04-10
Graduation design file (graphics algorithm design) - Reference image effect algorithm design the softwa... 2015-04-10
CheatEngine5.6 source code - Game cheat the 5.6 version of the source code, it ... 2015-04-10
Online ZhaXunWang science formula query V1.0 - Including junior middle school and high school sci... 2016-10-20
Observe science formula query v1.0 - Observe network science formulas 2016-10-20
Lele v1.1 QQ login system - "Le Le QQ Group landing system Ver1.1" * Fix QQ ... 2016-10-20
The new network domain name host distribution system V1.0 - Use Notepad to open \Global.asa idc1688 into your ... 2016-10-20
QQ group v2.1 release system - ha ha - "Copyright" This system is based on the Wu Meng de... 2016-10-20
Interesting content ASPCMS v1.0 - Update log: 2016-10-20
Residential feng shui fortune-telling v1.0 - The project according to the orientation of the ar... 2016-10-20
The self-help chain home beautiful - The self-help chain home beautiful 2016-10-20
EXW FLASH web site management system v2.0 - EXW FLASH introduction: EXW website management sys... 2016-10-20
WAP2.0 web site management system V1.0 - System installation steps 1, install the QuickWAP ... 2016-10-20

 Back to top