Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MyBarcode: :AxIDAutomation.AxBarCode
- public Image PictureAll
- {
- get
- {
- Image img;
- img = this.Picture;
- Bitmap barcode = new Bitmap(this.Picture);
- Graphics g = Graphics.FromImage(barcode);
- g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit;
- System.Drawing.SolidBrush myBrush = new System.Drawing.SolidBrush(System.Drawing.Color.Black);
- Font font = new Font("Arial",10);
- Pen pen = new Pen(myBrush);
- myBrush.Color = Color.White;
- Rectangle rectangle = new Rectangle(0, 0, Picture.Width, 20);
- g.FillRectangle(myBrush,rectangle );
- myBrush = new SolidBrush(Color.Black);
- StringFormat format = new StringFormat();
- format.Alignment=StringAlignment.Center;
- g.DrawString("Department-Iteam",font,myBrush,(RectangleF)rectangle,format);
- g.Flush();
- myBrush.Dispose();
- pen.Dispose();
- g.Dispose();
- return barcode;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement