放出两只小猪共祝大家新年快乐!(利用C#直接绘制的哟)

先看截图:
/*声明:BrawDraw.com, ZPXP.com版权所有:a3news(AT)hotmail.com,仅供学习,参考之用,切勿用于商业用途!*/

(1)正面
 两只小猪祝新年(正面)
(2)背面:
两只小猪祝新年(背面)

实现代码:
正面:
//TwoPigsWithChineseFu.cs
/*声明:BrawDraw.com, ZPXP.com版权所有:a3news(AT)hotmail.com,仅供学习,参考之用,切勿用于商业用途!*/
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Text;

namespace BrawDraw.Com.NewYearCard
{
 public class TwoPigsWithChineseFu : System.ComponentModel.Component
 {   
  private GraphicsContainer gContainer;
  private SolidBrush brush3 = new SolidBrush(Color.FromArgb(255, 251, 212, 251));   
  private SolidBrush brush4 = new SolidBrush(Color.FromArgb(255, 255, 34, 11));   
  private SolidBrush brush7 = new SolidBrush(Color.Yellow);   
  private Pen stroke1 = new Pen(Color.FromArgb(255, 0, 0, 0), 2F);   
  private Pen stroke2 = new Pen(Color.FromArgb(255, 252, 225, 1), 1F);
  private Pen stroke4 = new Pen(Color.FromArgb(255, 0, 0, 0), 1F);   
  private Pen stroke5 = new Pen(Color.FromArgb(255, 0, 0, 0), 3F);
  private StringFormat stringformat1 = new StringFormat(StringFormat.GenericTypographic);   
  protected GraphicsPath leftPig_Outer = new GraphicsPath(
   new PointF[] {
        new PointF(22F, 48F),
        new PointF(8F, 32F),
        new PointF(10F, 24F),
        new PointF(20F, 20F),
        new PointF(26F, 20F),
        new PointF(26F, 20F),
        new PointF(50F, 32F),
        new PointF(90F, 14F),
        new PointF(122F, 8F),
        new PointF(182F, 30F),
        new PointF(204F, 18F),
        new PointF(214F, 22F),
        new PointF(214F, 22F),
        new PointF(212F, 32F),
        new PointF(212F, 38F),
        new PointF(212F, 38F),
        new PointF(210F, 44F),
        new PointF(218F, 84F),
        new PointF(218F, 84F),
        new PointF(214F, 158F),
        new PointF(222F, 170F),
        new PointF(224F, 186F),
        new PointF(222F, 196F),
        new PointF(216F, 228F),
        new PointF(216F, 228F),
        new PointF(214F, 254F),
        new PointF(212F, 298F),
        new PointF(212F, 296F),
        new PointF(218F, 316F),
        new PointF(220F, 326F),
        new PointF(222F, 330F),
        new PointF(214F, 332F),
        new PointF(204F, 332F),
        new PointF(204F, 332F),
        new PointF(198F, 328F),
        new PointF(170F, 314F),
        new PointF(142F, 304F),
        new PointF(100F, 310F),
        new PointF(70F, 316F),
        new PointF(46F, 324F),
        new PointF(26F, 336F),
        new PointF(18F, 340F),
        new PointF(18F, 338F),
        new PointF(10F, 332F),
        new PointF(14F, 294F),
        new PointF(14F, 294F),
        new PointF(14F, 262F),
        new PointF(14F, 210F),
        new PointF(14F, 210F),
        new PointF(8F, 184F),
        new PointF(6F, 168F),
        new PointF(6F, 168F),
        new PointF(18F, 144F),
        new PointF(20F, 110F),
        new PointF(16F, 96F),
        new PointF(20F, 60F)},
   new System.Byte[] {
          0,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          1,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          131});
   
  private SolidBrush leftPig_OuterBrush = new SolidBrush(Color.FromArgb(255, 255, 255, 255));   
  protected GraphicsPath leftPig_LeftEye = new GraphicsPath(
   new PointF[] {
        new PointF(76F, 68F),
        new PointF(94F, 74F),
        new PointF(94F, 74F),
        new PointF(104F, 80F),
        new PointF(90F, 88F),
        new PointF(88F, 88F),
        new PointF(80F, 94F)},
   new System.Byte[] {
          0,
          3,
          3,
          3,
          3,
          3,
          3});
   
  protected GraphicsPath leftPig_RightEye = new GraphicsPath(
   new PointF[] {
        new PointF(194F, 68F),
        new PointF(170F, 76F),
        new PointF(170F, 76F),
        new PointF(166F, 82F),
        new PointF(188F, 88F),
        new PointF(188F, 88F),
        new PointF(196F, 96F)},
   new System.Byte[] {
          0,
          3,
          3,
          3,
          3,
          3,
          3});
   
  protected GraphicsPath leftPig_ApronOuter = new GraphicsPath(
   new PointF[] {
        new PointF(80F, 174F),
        new PointF(76F, 174F),
        new PointF(74F, 178F),
        new PointF(72F, 182F),
        new PointF(56F, 198F),
        new PointF(56F, 198F),
        new PointF(38F, 210F),
        new PointF(22F, 218F),
        new PointF(22F, 218F),
        new PointF(12F, 216F),
        new PointF(20F, 240F),
        new PointF(20F, 240F),
        new PointF(110F, 308F),
        new PointF(120F, 316F),
        new PointF(122F, 316F),
        new PointF(136F, 306F),
        new PointF(188F, 274F),
        new PointF(188F, 276F),
        new PointF(224F, 242F),
        new PointF(206F, 210F),
        new PointF(206F, 210F),
        new PointF(200F, 202F),
        new PointF(184F, 204F),
        new PointF(184F, 204F),
        new PointF(178F, 202F),
        new PointF(178F, 186F),
        new PointF(162F, 194F),
        new PointF(162F, 194F),
        new PointF(134F, 194F),
        new PointF(112F, 194F),
        new PointF(112F, 194F),
        new PointF(100F, 192F),
        new PointF(88F, 192F),
        new PointF(88F, 192F),
        new PointF(82F, 176F)},
   new System.Byte[] {
          0,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          1,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          131});
   
  private SolidBrush leftPig_ApronOuterBrush = new SolidBrush(Color.FromArgb(255, 246, 206, 17));
   
  protected GraphicsPath leftPig_CenterPath = new GraphicsPath(
   new PointF[] {
        new PointF(16F, 144F),
        new PointF(66F, 170F),
        new PointF(66F, 170F),
        new PointF(80F, 174F),
        new PointF(188F, 182F),
        new PointF(188F, 182F),
        new PointF(214F, 160F)},
   new System.Byte[] {
          0,
          3,
          3,
          3,
          3,
          3,
          3});
   
  private Pen leftPig_CenterPathPen = new Pen(Color.FromArgb(255, 255, 36, 7), 5F);
   
  protected GraphicsPath leftPig_RightHand = new GraphicsPath(
   new PointF[] {
        new PointF(204F, 168F),
        new PointF(194F, 176F),
        new PointF(192F, 176F),
        new PointF(178F, 178F),
        new PointF(178F, 202F),
        new PointF(198F, 204F),
        new PointF(198F, 204F),
        new PointF(214F, 196F)},
   new System.Byte[] {
          0,
          3,
          3,
          3,
          1,
          3,
          3,
          3});
   
  protected GraphicsPath leftPig_LeftHand = new GraphicsPath(
   new PointF[] {
        new PointF(34F, 162F),
        new PointF(42F, 168F),
        new PointF(42F, 168F),
        new PointF(56F, 172F),
        new PointF(58F, 184F),
        new PointF(58F, 184F),
        new PointF(56F, 196F),
        new PointF(28F, 194F),
        new PointF(30F, 194F),
        new PointF(22F, 188F)},
   new System.Byte[] {
          0,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3});
   
  protected GraphicsPath leftPig_MouthOuter = new GraphicsPath(
   new PointF[] {
        new PointF(84F, 128F),
        new PointF(122F, 114F),
        new PointF(122F, 114F),
        new PointF(176F, 124F),
        new PointF(184F, 150F),
        new PointF(184F, 150F),
        new PointF(176F, 186F),
        new PointF(160F, 194F),
        new PointF(160F, 194F),
        new PointF(116F, 194F),
        new PointF(92F, 192F),
        new PointF(90F, 192F),
        new PointF(88F, 188F),
        new PointF(80F, 174F),
        new PointF(80F, 174F),
        new PointF(82F, 134F)},
   new System.Byte[] {
          0,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          131});
   
  protected GraphicsPath leftPig_MouthInnerPath1 = new GraphicsPath(
   new PointF[] {
        new PointF(108F, 140F),
        new PointF(108F, 172F)},
   new System.Byte[] {
          0,
          1});
   
  protected GraphicsPath leftPig_MouthInnerPath2 = new GraphicsPath(
   new PointF[] {
        new PointF(158F, 140F),
        new PointF(158F, 166F),
        new PointF(158F, 166F),
        new PointF(156F, 172F)},
   new System.Byte[] {
          0,
          3,
          3,
          3});
   
  protected GraphicsPath leftPig_ApronInner = new GraphicsPath(
   new PointF[] {
        new PointF(138F, 196F),
        new PointF(100F, 228F),
        new PointF(130F, 266F),
        new PointF(168F, 236F)},
   new System.Byte[] {
          0,
          1,
          1,
          129});
   
  protected GraphicsPath rightPig_Outer = new GraphicsPath(
   new PointF[] {
        new PointF(256F, 46F),
        new PointF(242F, 30F),
        new PointF(244F, 22F),
        new PointF(254F, 18F),
        new PointF(260F, 18F),
        new PointF(260F, 18F),
        new PointF(284F, 30F),
        new PointF(324F, 12F),
        new PointF(356F, 6F),
        new PointF(416F, 28F),
        new PointF(438F, 16F),
        new PointF(446F, 14F),
        new PointF(452F, 20F),
        new PointF(450F, 30F),
        new PointF(446F, 36F),
        new PointF(446F, 36F),
        new PointF(444F, 42F),
        new PointF(446F, 60F),
        new PointF(452F, 82F),
        new PointF(448F, 156F),
        new PointF(456F, 168F),
        new PointF(458F, 184F),
        new PointF(456F, 194F),
        new PointF(450F, 226F),
        new PointF(450F, 226F),
        new PointF(448F, 252F),
        new PointF(446F, 296F),
        new PointF(446F, 294F),
        new PointF(452F, 314F),
        new PointF(454F, 324F),
        new PointF(456F, 328F),
        new PointF(453F, 332F),
        new PointF(443F, 340F),
        new PointF(438F, 330F),
        new PointF(432F, 326F),
        new PointF(404F, 312F),
        new PointF(376F, 302F),
        new PointF(334F, 308F),
        new PointF(304F, 314F),
        new PointF(280F, 322F),
        new PointF(268F, 326F),
        new PointF(256F, 332F),
        new PointF(252F, 336F),
        new PointF(244F, 330F),
        new PointF(248F, 292F),
        new PointF(248F, 292F),
        new PointF(248F, 260F),
        new PointF(248F, 208F),
        new PointF(248F, 208F),
        new PointF(246F, 192F),
        new PointF(246F, 172F),
        new PointF(246F, 164F),
        new PointF(252F, 142F),
        new PointF(248F, 108F),
        new PointF(244F, 96F),
        new PointF(252F, 56F)},
   new System.Byte[] {
          0,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          1,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          131});
   
  private SolidBrush rightPig_OuterBrush = new SolidBrush(Color.FromArgb(255, 226, 226, 226));
   
  protected GraphicsPath rightPig_LeftEye = new GraphicsPath(
   new PointF[] {
        new PointF(286F, 66F),
        new PointF(304F, 72F),
        new PointF(304F, 72F),
        new PointF(310F, 76F),
        new PointF(300F, 86F),
        new PointF(298F, 86F),
        new PointF(290F, 92F)},
   new System.Byte[] {
          0,
          3,
          3,
          3,
          3,
          3,
          3});
   
  protected GraphicsPath rightPig_RightEye = new GraphicsPath(
   new PointF[] {
        new PointF(402F, 62F),
        new PointF(378F, 70F),
        new PointF(378F, 70F),
        new PointF(372F, 76F),
        new PointF(396F, 82F),
        new PointF(396F, 82F),
        new PointF(404F, 90F)},
   new System.Byte[] {
          0,
          3,
          3,
          3,
          3,
          3,
          3});
   
  protected GraphicsPath rightPig_ApronOuter = new GraphicsPath(
   new PointF[] {
        new PointF(314F, 172F),
        new PointF(310F, 172F),
        new PointF(308F, 176F),
        new PointF(300F, 184F),
        new PointF(286F, 198F),
        new PointF(282F, 202F),
        new PointF(278F, 206F),
        new PointF(264F, 222F),
        new PointF(254F, 228F),
        new PointF(246F, 242F),
        new PointF(256F, 248F),
        new PointF(254F, 238F),
        new PointF(344F, 306F),
        new PointF(354F, 314F),
        new PointF(356F, 314F),
        new PointF(368F, 314F),
        new PointF(406F, 282F),
        new PointF(424F, 252F),
        new PointF(470F, 234F),
        new PointF(446F, 206F),
        new PointF(438F, 202F),
        new PointF(434F, 200F),
        new PointF(418F, 202F),
        new PointF(418F, 202F),
        new PointF(412F, 200F),
        new PointF(412F, 184F),
        new PointF(396F, 192F),
        new PointF(396F, 192F),
        new PointF(368F, 192F),
        new PointF(346F, 192F),
        new PointF(346F, 192F),
        new PointF(334F, 190F),
        new PointF(322F, 190F),
        new PointF(322F, 190F),
        new PointF(316F, 174F)},
   new System.Byte[] {
          0,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          1,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          131});
   
  private SolidBrush rightPig_ApronOuterBrush = new SolidBrush(Color.FromArgb(255, 122, 156, 226));
   
  protected GraphicsPath rightPig_CenterPath = new GraphicsPath(
   new PointF[] {
        new PointF(250F, 142F),
        new PointF(300F, 168F),
        new PointF(300F, 168F),
        new PointF(314F, 172F),
        new PointF(422F, 180F),
        new PointF(422F, 180F),
        new PointF(448F, 158F)},
   new System.Byte[] {
          0,
          3,
          3,
          3,
          3,
          3,
          3});
   
  private Pen rightPig_CenterPathPen = new Pen(Color.FromArgb(255, 71, 51, 190), 5F);
   
  protected GraphicsPath rightPig_RightHand = new GraphicsPath(
   new PointF[] {
        new PointF(438F, 166F),
        new PointF(428F, 174F),
        new PointF(426F, 174F),
        new PointF(414F, 184F),
        new PointF(416F, 202F),
        new PointF(432F, 202F),
        new PointF(432F, 202F),
        new PointF(448F, 194F)},
   new System.Byte[] {
          0,
          3,
          3,
          3,
          1,
          3,
          3,
          3});
   
  protected GraphicsPath rightPig_LeftHand = new GraphicsPath(
   new PointF[] {
        new PointF(268F, 154F),
        new PointF(276F, 160F),
        new PointF(276F, 160F),
        new PointF(294F, 170F),
        new PointF(296F, 178F),
        new PointF(292F, 176F),
        new PointF(292F, 186F),
        new PointF(274F, 186F),
        new PointF(268F, 182F),
        new PointF(258F, 176F)},
   new System.Byte[] {
          0,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3});
   
  protected GraphicsPath rightPig_MouthOuter = new GraphicsPath(
   new PointF[] {
        new PointF(304F, 130F),
        new PointF(330F, 112F),
        new PointF(366F, 110F),
        new PointF(394F, 132F),
        new PointF(404F, 134F),
        new PointF(402F, 148F),
        new PointF(394F, 184F),
        new PointF(378F, 192F),
        new PointF(378F, 192F),
        new PointF(334F, 192F),
        new PointF(316F, 190F),
        new PointF(308F, 190F),
        new PointF(306F, 186F),
        new PointF(298F, 172F),
        new PointF(298F, 172F),
        new PointF(302F, 142F)},
   new System.Byte[] {
          0,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          131});
   
  protected GraphicsPath rightPig_MouthInnerPath2 = new GraphicsPath(
   new PointF[] {
        new PointF(370F, 138F),
        new PointF(370F, 170F)},
   new System.Byte[] {
          0,
          1});
   
  protected GraphicsPath rightPig_MouthInnerPath1 = new GraphicsPath(
   new PointF[] {
        new PointF(328F, 140F),
        new PointF(328F, 166F),
        new PointF(328F, 166F),
        new PointF(326F, 172F)},
   new System.Byte[] {
          0,
          3,
          3,
          3});
   
  protected GraphicsPath rightPig_ApronInner = new GraphicsPath(
   new PointF[] {
        new PointF(352F, 194F),
        new PointF(314F, 226F),
        new PointF(352F, 264F),
        new PointF(388F, 228F)},
   new System.Byte[] {
          0,
          1,
          1,
          129});
   
  protected string wordFu_LeftInApron = "福";   
  private System.Single wordFu_LeftInApronPointX = 148;   
  private System.Single wordFu_LeftInApronPointY = 251;   
  private Font wordFu_LeftInApronFont = new Font("FZPangWa-M18", 27.75F, ((FontStyle)(0)), GraphicsUnit.Point, 1);   
  private PointF wordFu_LeftInApronRotationPoint = new PointF(153F, 251F);   
  private System.Single wordFu_LeftInApronRotation = 180F;   
  protected string wordFu_RightInApron = "福";   
  private System.Single wordFu_RightInApronPointX = 366;   
  private System.Single wordFu_RightInApronPointY = 248;   
  private Font wordFu_RightInApronFont = new Font("FZCuQian-M17", 27.75F, ((FontStyle)(0)), GraphicsUnit.Point, 1);   
  private PointF wordFu_RightInApronRotationPoint = new PointF(371F, 248F);   
  private System.Single wordFu_RightInApronRotation = 180F;
   
  public TwoPigsWithChineseFu()
  {
   this.InitializeGraphics();
  }
   
  private void InitializeGraphics()
  {
   this.stringformat1.Alignment = StringAlignment.Near;
  }
   
  public virtual void RenderGraphics(Graphics g)
  {
   g.SmoothingMode = SmoothingMode.AntiAlias;
   g.TextRenderingHint = TextRenderingHint.AntiAlias;
   g.FillPath(this.leftPig_OuterBrush, this.leftPig_Outer);
   g.DrawPath(this.stroke1, this.leftPig_Outer);
   g.DrawPath(this.stroke1, this.leftPig_LeftEye);
   g.DrawPath(this.stroke1, this.leftPig_RightEye);
   g.FillPath(this.leftPig_ApronOuterBrush, this.leftPig_ApronOuter);
   g.DrawPath(this.stroke2, this.leftPig_ApronOuter);
   g.DrawPath(this.leftPig_CenterPathPen, this.leftPig_CenterPath);
   g.DrawPath(this.stroke1, this.leftPig_RightHand);
   g.DrawPath(this.stroke1, this.leftPig_LeftHand);
   g.FillPath(this.brush3, this.leftPig_MouthOuter);
   g.DrawPath(this.stroke4, this.leftPig_MouthOuter);
   g.DrawPath(this.stroke5, this.leftPig_MouthInnerPath1);
   g.DrawPath(this.stroke5, this.leftPig_MouthInnerPath2);
   g.FillPath(this.brush4, this.leftPig_ApronInner);
   g.DrawPath(this.stroke2, this.leftPig_ApronInner);
   g.FillPath(this.rightPig_OuterBrush, this.rightPig_Outer);
   g.DrawPath(this.stroke1, this.rightPig_Outer);
   g.DrawPath(this.stroke1, this.rightPig_LeftEye);
   g.DrawPath(this.stroke1, this.rightPig_RightEye);
   g.FillPath(this.rightPig_ApronOuterBrush, this.rightPig_ApronOuter);
   g.DrawPath(this.stroke1, this.rightPig_ApronOuter);
   g.DrawPath(this.rightPig_CenterPathPen, this.rightPig_CenterPath);
   g.DrawPath(this.stroke1, this.rightPig_RightHand);
   g.DrawPath(this.stroke1, this.rightPig_LeftHand);
   g.FillPath(this.brush3, this.rightPig_MouthOuter);
   g.DrawPath(this.stroke4, this.rightPig_MouthOuter);
   g.DrawPath(this.stroke5, this.rightPig_MouthInnerPath2);
   g.DrawPath(this.stroke5, this.rightPig_MouthInnerPath1);
   g.FillPath(this.brush4, this.rightPig_ApronInner);
   g.DrawPath(this.stroke2, this.rightPig_ApronInner);
   this.beginRotation(g, this.wordFu_LeftInApronRotation, this.wordFu_LeftInApronRotationPoint);
   g.DrawString(this.wordFu_LeftInApron, this.wordFu_LeftInApronFont, this.brush7, this.wordFu_LeftInApronPointX, this.wordFu_LeftInApronPointY);
   this.endRotation(g);
   this.beginRotation(g, this.wordFu_RightInApronRotation, this.wordFu_RightInApronRotationPoint);
   g.DrawString(this.wordFu_RightInApron, this.wordFu_RightInApronFont, this.brush7, this.wordFu_RightInApronPointX, this.wordFu_RightInApronPointY);
   this.endRotation(g);
  }
   
  private void DisposeGraphics()
  {
   this.brush3.Dispose();
   this.brush4.Dispose();
   this.brush7.Dispose();
   this.stroke1.Dispose();
   this.stroke2.Dispose();
   this.stroke4.Dispose();
   this.stroke5.Dispose();
   this.stringformat1.Dispose();
   this.leftPig_Outer.Dispose();
   this.leftPig_OuterBrush.Dispose();
   this.leftPig_LeftEye.Dispose();
   this.leftPig_RightEye.Dispose();
   this.leftPig_ApronOuter.Dispose();
   this.leftPig_ApronOuterBrush.Dispose();
   this.leftPig_CenterPath.Dispose();
   this.leftPig_CenterPathPen.Dispose();
   this.leftPig_RightHand.Dispose();
   this.leftPig_LeftHand.Dispose();
   this.leftPig_MouthOuter.Dispose();
   this.leftPig_MouthInnerPath1.Dispose();
   this.leftPig_MouthInnerPath2.Dispose();
   this.leftPig_ApronInner.Dispose();
   this.rightPig_Outer.Dispose();
   this.rightPig_OuterBrush.Dispose();
   this.rightPig_LeftEye.Dispose();
   this.rightPig_RightEye.Dispose();
   this.rightPig_ApronOuter.Dispose();
   this.rightPig_ApronOuterBrush.Dispose();
   this.rightPig_CenterPath.Dispose();
   this.rightPig_CenterPathPen.Dispose();
   this.rightPig_RightHand.Dispose();
   this.rightPig_LeftHand.Dispose();
   this.rightPig_MouthOuter.Dispose();
   this.rightPig_MouthInnerPath2.Dispose();
   this.rightPig_MouthInnerPath1.Dispose();
   this.rightPig_ApronInner.Dispose();
   this.wordFu_LeftInApronFont.Dispose();
   this.wordFu_RightInApronFont.Dispose();
  }
   
  protected override void Dispose(bool disposing)
  {
   if (disposing)
   {
    this.DisposeGraphics();
   }
  }
   
  private void beginRotation(Graphics g, System.Single rotation, PointF rotationPoint)
  {
   Matrix mtx = new Matrix();
   this.gContainer = g.BeginContainer();
   mtx.RotateAt(rotation, rotationPoint);
   g.Transform = mtx;
   mtx.Dispose();
  }
   
  private void endRotation(Graphics g)
  {
   g.EndContainer(this.gContainer);
  }
 }
}


背面:
//TwoPigsBackShadow.cs
/*声明:BrawDraw.com, ZPXP.com版权所有:a3news(AT)hotmail.com,仅供学习,参考之用,切勿用于商业用途!*/
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Text;

namespace BrawDraw.Com.NewYearCard
{
 public class TwoPigsBackShadow : System.ComponentModel.Component
 {   
  private SolidBrush brush5 = new SolidBrush(Color.FromArgb(255, 255, 34, 4));
  private Pen stroke1 = new Pen(Color.FromArgb(255, 0, 0, 0), 3F);   
  private Pen stroke4 = new Pen(Color.FromArgb(0, 0, 0, 0), 0.001F);   
  private Font font1 = new Font("FZHuangCao-S09", 47F, ((FontStyle)(0)), GraphicsUnit.Point, 1);   
  private StringFormat stringformat1 = new StringFormat(StringFormat.GenericTypographic);   
  protected GraphicsPath leftPig_Outer = new GraphicsPath(
   new PointF[] {
        new PointF(54F, 6F),
        new PointF(76F, 20F),
        new PointF(88F, 20F),
        new PointF(88F, 20F),
        new PointF(106F, 14F),
        new PointF(164F, 12F),
        new PointF(164F, 12F),
        new PointF(214F, 34F),
        new PointF(240F, 26F),
        new PointF(240F, 26F),
        new PointF(250F, 26F),
        new PointF(256F, 38F),
        new PointF(256F, 38F),
        new PointF(244F, 54F),
        new PointF(246F, 84F),
        new PointF(246F, 84F),
        new PointF(238F, 156F),
        new PointF(198F, 166F),
        new PointF(196F, 166F),
        new PointF(204F, 180F),
        new PointF(204F, 200F),
        new PointF(204F, 200F),
        new PointF(208F, 200F),
        new PointF(226F, 202F),
        new PointF(226F, 202F),
        new PointF(238F, 208F),
        new PointF(234F, 228F),
        new PointF(234F, 228F),
        new PointF(230F, 284F),
        new PointF(226F, 304F),
        new PointF(224F, 312F),
        new PointF(216F, 318F),
        new PointF(200F, 330F),
        new PointF(188F, 338F),
        new PointF(174F, 336F),
        new PointF(162F, 336F),
        new PointF(162F, 336F),
        new PointF(138F, 322F),
        new PointF(122F, 316F),
        new PointF(114F, 312F),
        new PointF(92F, 322F),
        new PointF(70F, 326F),
        new PointF(58F, 326F),
        new PointF(46F, 316F),
        new PointF(36F, 306F),
        new PointF(28F, 298F),
        new PointF(22F, 282F),
        new PointF(22F, 236F),
        new PointF(22F, 236F),
        new PointF(28F, 194F),
        new PointF(18F, 202F),
        new PointF(12F, 202F),
        new PointF(4F, 196F),
        new PointF(2F, 180F),
        new PointF(32F, 150F),
        new PointF(34F, 80F),
        new PointF(32F, 80F),
        new PointF(48F, 30F),
        new PointF(44F, 14F),
        new PointF(44F, 14F),
        new PointF(52F, 6F)},
   new System.Byte[] {
          0,
          1,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          1,
          3,
          3,
          3,
          1,
          3,
          3,
          3,
          3,
          3,
          131});
   
  private SolidBrush leftPig_OuterBrush = new SolidBrush(Color.FromArgb(255, 255, 255, 255));
   
  protected GraphicsPath leftPig_InnerCurve1 = new GraphicsPath(
   new PointF[] {
        new PointF(32F, 146F),
        new PointF(90F, 180F),
        new PointF(128F, 194F),
        new PointF(202F, 172F)},
   new System.Byte[] {
          0,
          3,
          3,
          3});
   
  private Pen leftPig_InnerCurve1Pen = new Pen(Color.FromArgb(255, 251, 41, 0), 5F);
   
  protected GraphicsPath leftPig_InnerCurve2 = new GraphicsPath(
   new PointF[] {
        new PointF(120F, 182F),
        new PointF(112F, 188F),
        new PointF(110F, 190F),
        new PointF(108F, 192F),
        new PointF(106F, 196F),
        new PointF(108F, 200F),
        new PointF(112F, 200F),
        new PointF(124F, 196F),
        new PointF(122F, 196F),
        new PointF(126F, 182F),
        new PointF(118F, 190F),
        new PointF(118F, 190F),
        new PointF(118F, 196F),
        new PointF(116F, 208F),
        new PointF(116F, 210F),
        new PointF(126F, 216F),
        new PointF(132F, 212F),
        new PointF(136F, 208F),
        new PointF(134F, 198F),
        new PointF(130F, 188F),
        new PointF(130F, 188F),
        new PointF(124F, 182F),
        new PointF(128F, 204F),
        new PointF(128F, 204F),
        new PointF(122F, 214F),
        new PointF(110F, 220F),
        new PointF(106F, 222F),
        new PointF(106F, 228F)},
   new System.Byte[] {
          0,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3});
   
  private Pen leftPig_InnerCurve2Pen = new Pen(Color.FromArgb(255, 251, 41, 0), 2F);
   
  protected GraphicsPath leftPig_InnerBottom = new GraphicsPath(
   new PointF[] {
        new PointF(22F, 230F),
        new PointF(16F, 244F),
        new PointF(16F, 242F),
        new PointF(20F, 258F),
        new PointF(36F, 258F),
        new PointF(36F, 258F),
        new PointF(64F, 250F),
        new PointF(130F, 248F),
        new PointF(130F, 248F),
        new PointF(188F, 266F),
        new PointF(218F, 286F),
        new PointF(218F, 286F),
        new PointF(232F, 282F),
        new PointF(238F, 264F),
        new PointF(236F, 264F),
        new PointF(234F, 256F),
        new PointF(218F, 258F),
        new PointF(218F, 258F),
        new PointF(198F, 264F),
        new PointF(162F, 250F),
        new PointF(162F, 250F),
        new PointF(116F, 244F),
        new PointF(84F, 242F),
        new PointF(86F, 242F),
        new PointF(56F, 244F)},
   new System.Byte[] {
          0,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          131});
   
  private SolidBrush leftPig_InnerBottomBrush = new SolidBrush(Color.FromArgb(255, 255, 18, 0));
   
  protected GraphicsPath rightPig_Outer = new GraphicsPath(
   new PointF[] {
        new PointF(240F, 28F),
        new PointF(240F, 14F),
        new PointF(240F, 14F),
        new PointF(248F, 8F),
        new PointF(270F, 20F),
        new PointF(278F, 22F),
        new PointF(278F, 20F),
        new PointF(300F, 14F),
        new PointF(340F, 2F),
        new PointF(372F, 4F),
        new PointF(404F, 20F),
        new PointF(416F, 22F),
        new PointF(414F, 22F),
        new PointF(426F, 20F),
        new PointF(446F, 8F),
        new PointF(446F, 8F),
        new PointF(454F, 14F),
        new PointF(458F, 26F),
        new PointF(458F, 26F),
        new PointF(450F, 38F),
        new PointF(448F, 42F),
        new PointF(448F, 42F),
        new PointF(450F, 52F),
        new PointF(452F, 86F),
        new PointF(452F, 86F),
        new PointF(452F, 144F),
        new PointF(454F, 150F),
        new PointF(454F, 150F),
        new PointF(468F, 162F),
        new PointF(480F, 170F),
        new PointF(482F, 174F),
        new PointF(480F, 180F),
        new PointF(474F, 198F),
        new PointF(474F, 198F),
        new PointF(470F, 198F),
        new PointF(454F, 198F),
        new PointF(454F, 272F),
        new PointF(454F, 298F),
        new PointF(454F, 298F),
        new PointF(446F, 316F),
        new PointF(418F, 340F),
        new PointF(418F, 340F),
        new PointF(404F, 340F),
        new PointF(382F, 336F),
        new PointF(382F, 336F),
        new PointF(358F, 326F),
        new PointF(340F, 320F),
        new PointF(340F, 320F),
        new PointF(306F, 336F),
        new PointF(278F, 336F),
        new PointF(278F, 336F),
        new PointF(262F, 326F),
        new PointF(250F, 314F),
        new PointF(242F, 308F),
        new PointF(240F, 296F),
        new PointF(236F, 264F),
        new PointF(234F, 244F),
        new PointF(236F, 206F),
        new PointF(224F, 202F),
        new PointF(224F, 202F),
        new PointF(204F, 200F),
        new PointF(204F, 180F),
        new PointF(198F, 170F),
        new PointF(198F, 170F),
        new PointF(206F, 164F),
        new PointF(222F, 160F),
        new PointF(222F, 160F),
        new PointF(238F, 156F),
        new PointF(246F, 82F),
        new PointF(246F, 84F),
        new PointF(244F, 52F),
        new PointF(256F, 40F),
        new PointF(256F, 40F),
        new PointF(250F, 24F)},
   new System.Byte[] {
          0,
          3,
          3,
          3,
          1,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          1,
          1,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          1,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          131});
   
  private SolidBrush rightPig_OuterBrush = new SolidBrush(Color.FromArgb(255, 216, 216, 216));
   
  protected GraphicsPath rightPig_InnerCurve1 = new GraphicsPath(
   new PointF[] {
        new PointF(238F, 156F),
        new PointF(304F, 190F),
        new PointF(382F, 196F),
        new PointF(452F, 146F)},
   new System.Byte[] {
          0,
          3,
          3,
          3});
   
  private Pen rightPig_InnerCurve1Pen = new Pen(Color.FromArgb(255, 18, 4, 148), 5.001F);
   
  protected GraphicsPath rightPig_InnerBottom = new GraphicsPath(
   new PointF[] {
        new PointF(234F, 244F),
        new PointF(270F, 256F),
        new PointF(310F, 246F),
        new PointF(376F, 246F),
        new PointF(422F, 262F),
        new PointF(454F, 252F),
        new PointF(456F, 266F),
        new PointF(456F, 274F),
        new PointF(454F, 284F),
        new PointF(424F, 274F),
        new PointF(424F, 274F),
        new PointF(412F, 266F),
        new PointF(378F, 254F),
        new PointF(320F, 252F),
        new PointF(280F, 260F),
        new PointF(258F, 272F),
        new PointF(244F, 276F),
        new PointF(238F, 274F)},
   new System.Byte[] {
          0,
          1,
          3,
          3,
          3,
          1,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          131});
   
  private SolidBrush rightPig_InnerBottomBrush = new SolidBrush(Color.FromArgb(255, 13, 36, 172));
   
  protected GraphicsPath OpenPath8 = new GraphicsPath(
   new PointF[] {
        new PointF(339F, 183F),
        new PointF(331F, 189F),
        new PointF(329F, 191F),
        new PointF(327F, 193F),
        new PointF(325F, 197F),
        new PointF(327F, 201F),
        new PointF(331F, 201F),
        new PointF(343F, 197F),
        new PointF(341F, 197F),
        new PointF(345F, 183F),
        new PointF(337F, 191F),
        new PointF(337F, 191F),
        new PointF(337F, 197F),
        new PointF(335F, 209F),
        new PointF(335F, 211F),
        new PointF(345F, 217F),
        new PointF(351F, 213F),
        new PointF(355F, 209F),
        new PointF(353F, 199F),
        new PointF(349F, 189F),
        new PointF(349F, 189F),
        new PointF(343F, 183F),
        new PointF(347F, 205F),
        new PointF(347F, 205F),
        new PointF(341F, 215F),
        new PointF(329F, 221F),
        new PointF(325F, 223F),
        new PointF(325F, 229F)},
   new System.Byte[] {
          0,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3,
          3});
   
  private Pen OpenPath8Pen = new Pen(Color.FromArgb(255, 18, 4, 148), 2.001F);   
  protected string wordNewYear = "新年";   
  private System.Single wordNewYearPointX = 80;   
  private System.Single wordNewYearPointY = 114;   
  protected string wordHappy = "快乐";   
  private System.Single wordHappyPointX = 285;   
  private System.Single wordHappyPointY = 116;   
  protected string word2007 = "2007";   
  private System.Single word2007PointX = 170;   
  private System.Single word2007PointY = 216;   
  private Font word2007Font = new Font("FZKangTi-S07", 19F, ((FontStyle)(0)), GraphicsUnit.Point, 1);   
  private SolidBrush word2007Brush = new SolidBrush(Color.FromArgb(255, 0, 0, 0));   
  protected string wordLunaryYear = "丁亥年";   
  private System.Single wordLunaryYearPointX = 239;   
  private System.Single wordLunaryYearPointY = 218;   
  private Font wordLunaryYearFont = new Font("FZYaoTi", 14F, ((FontStyle)(0)), GraphicsUnit.Point, 1);
   
  public TwoPigsBackShadow()
  {
   this.InitializeGraphics();
  }
   
  private void InitializeGraphics()
  {
   this.stringformat1.Alignment = StringAlignment.Near;
  }
   
  public virtual void RenderGraphics(Graphics g)
  {
   g.SmoothingMode = SmoothingMode.AntiAlias;
   g.TextRenderingHint = TextRenderingHint.AntiAlias;
   g.FillPath(this.leftPig_OuterBrush, this.leftPig_Outer);
   g.DrawPath(this.stroke1, this.leftPig_Outer);
   g.DrawPath(this.leftPig_InnerCurve1Pen, this.leftPig_InnerCurve1);
   g.DrawPath(this.leftPig_InnerCurve2Pen, this.leftPig_InnerCurve2);
   g.FillPath(this.leftPig_InnerBottomBrush, this.leftPig_InnerBottom);
   g.DrawPath(this.stroke4, this.leftPig_InnerBottom);
   g.FillPath(this.rightPig_OuterBrush, this.rightPig_Outer);
   g.DrawPath(this.stroke1, this.rightPig_Outer);
   g.DrawPath(this.rightPig_InnerCurve1Pen, this.rightPig_InnerCurve1);
   g.FillPath(this.rightPig_InnerBottomBrush, this.rightPig_InnerBottom);
   g.DrawPath(this.stroke4, this.rightPig_InnerBottom);
   g.DrawPath(this.OpenPath8Pen, this.OpenPath8);
   g.DrawString(this.wordNewYear, this.font1, this.brush5, this.wordNewYearPointX, this.wordNewYearPointY);
   g.DrawString(this.wordHappy, this.font1, this.brush5, this.wordHappyPointX, this.wordHappyPointY);
   g.DrawString(this.word2007, this.word2007Font, this.word2007Brush, this.word2007PointX, this.word2007PointY);
   g.DrawString(this.wordLunaryYear, this.wordLunaryYearFont, this.brush5, this.wordLunaryYearPointX, this.wordLunaryYearPointY);
  }
   
  private void DisposeGraphics()
  {
   this.brush5.Dispose();
   this.stroke1.Dispose();
   this.stroke4.Dispose();
   this.font1.Dispose();
   this.stringformat1.Dispose();
   this.leftPig_Outer.Dispose();
   this.leftPig_OuterBrush.Dispose();
   this.leftPig_InnerCurve1.Dispose();
   this.leftPig_InnerCurve1Pen.Dispose();
   this.leftPig_InnerCurve2.Dispose();
   this.leftPig_InnerCurve2Pen.Dispose();
   this.leftPig_InnerBottom.Dispose();
   this.leftPig_InnerBottomBrush.Dispose();
   this.rightPig_Outer.Dispose();
   this.rightPig_OuterBrush.Dispose();
   this.rightPig_InnerCurve1.Dispose();
   this.rightPig_InnerCurve1Pen.Dispose();
   this.rightPig_InnerBottom.Dispose();
   this.rightPig_InnerBottomBrush.Dispose();
   this.OpenPath8.Dispose();
   this.OpenPath8Pen.Dispose();
   this.word2007Font.Dispose();
   this.word2007Brush.Dispose();
   this.wordLunaryYearFont.Dispose();
  }
   
  protected override void Dispose(bool disposing)
  {
   if (disposing)
   {
    this.DisposeGraphics();
   }
  }
 }
}
测试代码:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using BrawDraw.Com.NewYearCard;

namespace NewYearCardTwoPigsTest
{
 /// <summary>
 /// Form1 的摘要说明。
 /// </summary>
 public class Form1 : System.Windows.Forms.Form
 {
  private System.Windows.Forms.Button button1;
  private System.Windows.Forms.Button button2;
  /// <summary>
  /// 必需的设计器变量。
  /// </summary>
  private System.ComponentModel.Container components = null;
  Bitmap m_Bitmap = null;

  public Form1()
  {
   //
   // Windows 窗体设计器支持所必需的
   //
   InitializeComponent();

   //
   // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
   //
  }

  /// <summary>
  /// 清理所有正在使用的资源。
  /// </summary>
  protected override void Dispose( bool disposing )
  {
   if( disposing )
   {
    if (components != null)
    {
     components.Dispose();
    }
   }
   base.Dispose( disposing );
  }

  #region Windows 窗体设计器生成的代码
  /// <summary>
  /// 设计器支持所需的方法 - 不要使用代码编辑器修改
  /// 此方法的内容。
  /// </summary>
  private void InitializeComponent()
  {
   this.button1 = new System.Windows.Forms.Button();
   this.button2 = new System.Windows.Forms.Button();
   this.SuspendLayout();
   //
   // button1
   //
   this.button1.Location = new System.Drawing.Point(688, 32);
   this.button1.Name = "button1";
   this.button1.TabIndex = 0;
   this.button1.Text = "Front";
   this.button1.Click += new System.EventHandler(this.button1_Click);
   //
   // button2
   //
   this.button2.Location = new System.Drawing.Point(688, 64);
   this.button2.Name = "button2";
   this.button2.TabIndex = 1;
   this.button2.Text = "Back";
   this.button2.Click += new System.EventHandler(this.button2_Click);
   //
   // Form1
   //
   this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
   this.ClientSize = new System.Drawing.Size(776, 654);
   this.Controls.Add(this.button2);
   this.Controls.Add(this.button1);
   this.Name = "Form1";
   this.Text = "Form1";
   this.ResumeLayout(false);

  }
  #endregion

  protected override void OnPaint(PaintEventArgs e)
  {
   base.OnPaint (e);
   if(m_Bitmap != null)
   {
    e.Graphics.DrawImage(m_Bitmap, 0, 0);
   }
  }

  /// <summary>
  /// 应用程序的主入口点。
  /// </summary>
  [STAThread]
  static void Main()
  {
   Application.Run(new Form1());
  }

  private void button1_Click(object sender, System.EventArgs e)
  {
   m_Bitmap = new Bitmap(this.ClientSize.Width, this.ClientSize.Height);
   Graphics g = Graphics.FromImage(m_Bitmap);
   g.Clear(Color.White);
   TwoPigsWithChineseFu twoPigs = new TwoPigsWithChineseFu();
   twoPigs.RenderGraphics(g);
   g.Dispose();
   twoPigs.Dispose();
   this.Invalidate();
  }

  private void button2_Click(object sender, System.EventArgs e)
  {
   m_Bitmap = new Bitmap(this.ClientSize.Width, this.ClientSize.Height);
   Graphics g = Graphics.FromImage(m_Bitmap);
   g.Clear(Color.White);
   TwoPigsBackShadow twoPigs = new TwoPigsBackShadow();
   twoPigs.RenderGraphics(g);
   g.Dispose();
   twoPigs.Dispose();
   this.Invalidate();
  }
 }
}

祝各位新年快乐!2007年健康快乐!

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值