Barcode to Image

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Barcode to Image

Adriano Iannotta
Hi,
 
is it possible to convert a Barcode to a System.Drawing.Image ?
 
Thanks
 
Adriano
 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Barcode to Image

Paulo Soares
Yes, if you care to write the code. No, if you want something already
done. The easiest way is to see what's done in Java where it essentially
creates a bitmap array and wraps it inside an java.awt.Image. I'll think
about this for a future inclusion or if you do it yourself and want to
share the code I'll include it in the distribution.

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On
> Behalf Of Adriano Iannotta
> Sent: Friday, November 25, 2005 4:29 PM
> To: [hidden email]
> Subject: [itextsharp-questions] Barcode to Image
>
> Hi,
>  
> is it possible to convert a Barcode to a System.Drawing.Image ?
>  
> Thanks
>  
> Adriano
>  
>


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
<a href="http://ads.osdn.com/?ad_idv37&alloc_id865&op=click">http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
itextsharp-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Barcode to Image

	anthonyzz
This post has NOT been accepted by the mailing list yet.
In reply to this post by Adriano Iannotta
this is my code for converting barcode image format
Color BackColor = Color.White;
            String FontName = "IDAutomationSC128M DEMO";
            string Fontaname1 = "ARIAL";
            int FontSize = 11;
            int fontSize1 = 8;
            int Height2 = 80;
            int Width2 = 175;
           string a,b,c;
           IDAutomationBarcodeObject = new clsBarCode();
            a = IDAutomationBarcodeObject.Code128(txtEnter.Text, true);
            b = "Some Sample Name";
            c = "Product Description";
 
            Bitmap bitmap = new Bitmap(Width2, Height2);
            Graphics graphics = Graphics.FromImage(bitmap);
            Color color = Color.Gray; ;
            Font font = new Font(FontName, FontSize);
            Font Font1 = new Font(Fontaname1, fontSize1);
 
            SolidBrush BrushBackColor = new SolidBrush(BackColor);
            Pen BorderPen = new Pen(color);
 
            Rectangle displayRectangle1 = new Rectangle(new Point(0, 0), new Size(Width2 - 1, Height2 - 2));
 
            graphics.FillRectangle(BrushBackColor, displayRectangle1);
            graphics.DrawString(b, Font1, Brushes.Black, 0, 0);
            graphics.DrawString(a, font, Brushes.Black, 4, 15);
            graphics.DrawString(c, Font1, Brushes.Black, 0, 63);
 
            pictureBox1.Image = bitmap;
            bitmap.Save("c:\\button11.bmp", System.Drawing.Imaging.ImageFormat.Bmp);
hope it helps. And if you want more info about barcode image or barcode font, just follow the guide.
Loading...