Advertisement
f0rkB0mb

Property PictureAll

Dec 16th, 2012
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class MyBarcode : AxIDAutomation.AxBarCode
  2. //...
  3. public Image PictureAll
  4. {
  5.     get
  6.     {
  7.         Image img;
  8.         img = this.Picture;
  9.         Bitmap barcode = new Bitmap(this.Picture);
  10.         Graphics g = Graphics.FromImage(barcode);
  11.         g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit;
  12.         System.Drawing.SolidBrush myBrush = new System.Drawing.SolidBrush(System.Drawing.Color.Black);
  13.         Font font = new Font("Arial",10);
  14.         Pen pen = new Pen(myBrush);
  15.         myBrush.Color = Color.White;
  16.         Rectangle rectangle = new Rectangle(0, 0, Picture.Width, 20);
  17.         g.FillRectangle(myBrush,rectangle );
  18.         myBrush = new SolidBrush(Color.Black);
  19.         StringFormat format = new StringFormat();
  20.         format.Alignment=StringAlignment.Center;
  21.         g.DrawString("Department-Iteam",font,myBrush,(RectangleF)rectangle,format);
  22.         g.Flush();
  23.         myBrush.Dispose();
  24.         pen.Dispose();
  25.         g.Dispose();
  26.         return barcode;
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement