Advertisement
f0rkB0mb

AxIDAutomation.AxBarCode - Class

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