473,322 Members | 1,523 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

how can i create an Image Object with a string or barcode

now, i want to create a Image object, which is a white rectangle with a
specific size of area, and a black string or barcode will be on it.

any api or sample code or ideas?

thanks!
Nov 15 '05 #1
3 1490
Hi,

System.Drawing.SizeF lobjRegion =
this.CreateGraphics().MeasureString(myTEXTCOMES HERE, this.Font);
Bitmap lobjBitmap = new
Bitmap(System.Convert.ToInt32(lobjRegion.Width)+1, this.Font.Height+2);
Graphics lobjGraphic = Graphics.FromImage(lobjBitmap);
SolidBrush lobjBrush = new SolidBrush(Color.LightYellow);
lobjGraphic.DrawRectangle(new
Pen(Color.Black),0,0,lobjRegion.Width,lobjRegion.H eight);
lobjGraphic.FillRectangle(lobjBrush,1,1,lobjRegion .Width-2,lobjRegion.Height
-1);
lobjGraphic.DrawString (myTEXTCOMES HERE, this.Font,
Brushes.Black,System.Drawing.RectangleF.Empty,Stri ngFormat.GenericDefault);
Nirosh

"Mullin Yu" <mu*******@ctil.com> wrote in message
news:ey*************@TK2MSFTNGP11.phx.gbl...
now, i want to create a Image object, which is a white rectangle with a
specific size of area, and a black string or barcode will be on it.

any api or sample code or ideas?

thanks!

Nov 15 '05 #2
There are barcode fonts available - try a google search.

Regards

Ron

"Mullin Yu" <mu*******@ctil.com> wrote in message
news:ey*************@TK2MSFTNGP11.phx.gbl...
now, i want to create a Image object, which is a white rectangle with a
specific size of area, and a black string or barcode will be on it.

any api or sample code or ideas?

thanks!

Nov 15 '05 #3
"Mullin Yu" <mu*******@ctil.com> wrote in message news:<ey*************@TK2MSFTNGP11.phx.gbl>...
now, i want to create a Image object, which is a white rectangle with a
specific size of area, and a black string or barcode will be on it.

any api or sample code or ideas?

thanks!


I would suggest using a barcode font - take a look at
www.morovia.com/font/ if you do not know them. Easy, simple and
covenient.
Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Steffen Brodowski | last post by:
Hello everyone, since one week, I'm programming with python. Its a realy interesting tool. I wrote a script for generating barcodes in jpg-format. Everything is ok, but my function...
9
by: Krishna Sagiraju | last post by:
Hai, I gotta decode a barcode from an image ( ppm, bmp, or jpg). I realize the first milestone would be to recognize a barcode with in the image: I took a small window (say 80X80 pixels) and if...
1
by: Krishna Sagiraju | last post by:
Hai, I gotta decode a barcode from an image ( ppm, bmp, or jpg). I realize the first milestone would be to recognize a barcode with in the image: I took a small window (say 80X80 pixels) and if...
4
by: Clark Stevens | last post by:
I have a program that I'm converting from VB6 to VB.NET. It reads in a text file containing barcode numbers and their corresponding descriptions. Then the user enters the barcode number and the...
4
by: Elhanan | last post by:
hi.. i'm trying to think of a way for a web page to contain barcode and still be archvied. i cannot use the usuall servlet/activex server side solutions becouse this page needs to be sent...
1
by: MaryamSh | last post by:
Hi, I am creating a Dynamic Search in my application. I create a user control and in Page_load event I create a dynamic dropdownlist and 2 dynamic button (Add,Remove) By pressing Add button...
4
by: kurapix | last post by:
Hi there!!! I've been working on recognizing EAN barcodes from images. Yes it's about recognizing barcodes from images but from bars not from the digit with the help of OCR software but with...
11
by: Mark B | last post by:
I want to display a pre-designed graphical 'performance badge' on certain webpages (round, about 2cm diameter) next to a salesperson's details. I have a function,...
13
by: daniam | last post by:
I am working on write a program that reads and writes from the barcode my problem when writing (send command to barcode) I read in pdf manufacturer barcode that the command of capturing the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.