Adjusting barcode size
4 posts • Page 1 of 1
Adjusting barcode size
hello
I need to change the size of the picture of the bar code ocx, and it is not allowing me.
mvrBarCode1.Picture.Width and mvrBarCode1.Picture.height seem to be readonly, and they are too big for the bar code of symbology and parameters of my choice, and I need to reprint it on a label sheet, several ones on the same line, and several lines on the page,
how can I change the bar code picture size, to be able to print in less space,
thank you
I need to change the size of the picture of the bar code ocx, and it is not allowing me.
mvrBarCode1.Picture.Width and mvrBarCode1.Picture.height seem to be readonly, and they are too big for the bar code of symbology and parameters of my choice, and I need to reprint it on a label sheet, several ones on the same line, and several lines on the page,
how can I change the bar code picture size, to be able to print in less space,
thank you
- mhelal(Legacy member)
Re: Adjusting barcode size
To adjust the barcode size, set NarrowBarWidth, BarHeight properties (linear barcodes). For PDF417 and DataMatrix barcodes, take a look at PDF417ModuleHeight, PDF417ModuleWidth and DataMatrixModuleSize properties.
- glitch (legacy member)
Re: Adjusting barcode size
Hello,
Thank you for replying, I am using EAN13, and trying the NarrowBarWidth, BarHeight properties change the sizes of the bar code itself, not the image it draws the barcode inside. So the bar code itself looks smaller inside the size of the picture that is: mvrBarCode1.Picture.Width and mvrBarCode1.Picture.height and has fixed read only sizes
I think these 2 properties are what decide the printing size, because when I print the picture of the bar code, it prints only one bar code image in the page, and I can't print again, as the size from the next x, or y position in the page, exceeds the printer width or height. While the actual printing of the bar code consumed less area within the picture size, and it seems so far that there is no overlapping of the printing of the bar code image,
Like if I print 2 images on the same raw: it looks like that:
X = 1
Y = 1
Printer.PaintPicture MyBarCode.Picture, X, Y
Then the second image should be on
X = X + MyBarCode.Picture.Width
Printer.PaintPicture MyBarCode.Picture, X, Y
and so on, till (X > Printer.ScaleWidth - MyBarCode.Picture.Width), I start new page and reset X and Y as follows
X = 1
Y = Y + MyBarCode.Picture.Height
Printer.PaintPicture MyBarCode.Picture, X, Y
And so on, till (Y > Printer.ScaleHeight - MyBarCode.Picture.Height), I start a new page and reset X and Y as follows
Printer.NewPage
X = 1
Y = 1
Printer.PaintPicture MyBarCode.Picture, X, Y
And so on till I finish all the bar codes I have. this code doesn't work, because the size of the bar picture gets more than the width of the printer after the first one, and I can't print the first bar code in any area away from the top left corner of the page, which is strange.
So, my question is: is it possible to print the bar code images several times on the same page, positioning them where I need on a preformatted label sheet, and if the picture sizes are too big, while the bar code itself is too small within the picture, can I overlap printing over the empty picture space, my testing so far proves that I can not?
Can you please advise, I appreciate your help, thank you,
Manal
Edited by mhelal on May 26 2005 at 2:39am
Thank you for replying, I am using EAN13, and trying the NarrowBarWidth, BarHeight properties change the sizes of the bar code itself, not the image it draws the barcode inside. So the bar code itself looks smaller inside the size of the picture that is: mvrBarCode1.Picture.Width and mvrBarCode1.Picture.height and has fixed read only sizes
I think these 2 properties are what decide the printing size, because when I print the picture of the bar code, it prints only one bar code image in the page, and I can't print again, as the size from the next x, or y position in the page, exceeds the printer width or height. While the actual printing of the bar code consumed less area within the picture size, and it seems so far that there is no overlapping of the printing of the bar code image,
Like if I print 2 images on the same raw: it looks like that:
X = 1
Y = 1
Printer.PaintPicture MyBarCode.Picture, X, Y
Then the second image should be on
X = X + MyBarCode.Picture.Width
Printer.PaintPicture MyBarCode.Picture, X, Y
and so on, till (X > Printer.ScaleWidth - MyBarCode.Picture.Width), I start new page and reset X and Y as follows
X = 1
Y = Y + MyBarCode.Picture.Height
Printer.PaintPicture MyBarCode.Picture, X, Y
And so on, till (Y > Printer.ScaleHeight - MyBarCode.Picture.Height), I start a new page and reset X and Y as follows
Printer.NewPage
X = 1
Y = 1
Printer.PaintPicture MyBarCode.Picture, X, Y
And so on till I finish all the bar codes I have. this code doesn't work, because the size of the bar picture gets more than the width of the printer after the first one, and I can't print the first bar code in any area away from the top left corner of the page, which is strange.
So, my question is: is it possible to print the bar code images several times on the same page, positioning them where I need on a preformatted label sheet, and if the picture sizes are too big, while the bar code itself is too small within the picture, can I overlap printing over the empty picture space, my testing so far proves that I can not?
Can you please advise, I appreciate your help, thank you,
Manal
Edited by mhelal on May 26 2005 at 2:39am
- mhelal(Legacy member)
Re: Adjusting barcode size
Be careful when you use Printer object in Visual Basic.
By default, the Printer object uses Twips scale mode, under which 1 inch is mapped to 1440 units. But the Picture object uses HIMETRIC scale mode, under which 1 unit equals to 1/1000 cm.
Morovia Barcode Activex Gives you option either to use HIMETRIC or HIENGLISH. By default it is HIENGLISH and 1 unit equals to 1/1000 inch.
So if you want the barcode printed from (1 inch, 1 inch) you need to set
X = 1*1440
Y= 1*1440
Now when you print the next barcode, you need adds the TWIPS units:
X = X + Picture.Width*1.44/2.54
Y = Y + Picture.Height*1.44/2.54
Or you can use the properties provided by the Barcode ActiveX (Assuming that you set Measurement to mbxMeasureEnglish)
X = X + myBarcode1.LabelWidth*1.44
Y= Y + myBarcode1.LabelHeight*1.44
Try that and let me know if it works.
By default, the Printer object uses Twips scale mode, under which 1 inch is mapped to 1440 units. But the Picture object uses HIMETRIC scale mode, under which 1 unit equals to 1/1000 cm.
Morovia Barcode Activex Gives you option either to use HIMETRIC or HIENGLISH. By default it is HIENGLISH and 1 unit equals to 1/1000 inch.
So if you want the barcode printed from (1 inch, 1 inch) you need to set
X = 1*1440
Y= 1*1440
Now when you print the next barcode, you need adds the TWIPS units:
X = X + Picture.Width*1.44/2.54
Y = Y + Picture.Height*1.44/2.54
Or you can use the properties provided by the Barcode ActiveX (Assuming that you set Measurement to mbxMeasureEnglish)
X = X + myBarcode1.LabelWidth*1.44
Y= Y + myBarcode1.LabelHeight*1.44
Try that and let me know if it works.
- glitch (legacy member)
4 posts • Page 1 of 1
Return to Barcode ActiveX Control
Who is online
Users browsing this forum: No registered users and 1 guest