|
RS 2005: Вывод barcode
|
|||
---|---|---|---|
#18+
Добрый день! Посоветуйте как можно в отчете вывести штрихкод в отчете (как рисунок, шрифтами или чтонить еще). Спасибо. ... |
|||
:
Нравится:
Не нравится:
|
|||
07.06.2006, 11:51 |
|
RS 2005: Вывод barcode
|
|||
---|---|---|---|
#18+
Есть ttf-шрифты для печати баркодов. ... |
|||
:
Нравится:
Не нравится:
|
|||
07.06.2006, 16:40 |
|
RS 2005: Вывод barcode
|
|||
---|---|---|---|
#18+
' Creates a bitmap image of the data parameter Public Function CreateBarcodeImage(ByVal data As String) As System.Drawing.Bitmap Dim dataIn As String 'Since this is for Code 3 of 9 only right now, add the leading and trailing asterisks to the data dataIn = data 'Create the Bitmap we'll be using Dim barCode As New System.Drawing.Bitmap(1, 1) 'Get a reference to the 3 of 9 barcode font Dim threeOfNine As New System.Drawing.Font("3 of 9 Barcode", 60, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point) 'Get a graphics object to work with Dim graphics As System.Drawing.Graphics = graphics.FromImage(barCode) 'Now we need to get the width and height that our 'data will cover after it is rendered with the 3 of 9 font Dim dataSize As System.Drawing.SizeF = graphics.MeasureString(dataIn, threeOfNine) 'Now we base the Bitmap's size off of this data. barCode = New System.Drawing.Bitmap(barCode, dataSize.ToSize()) 'Refresh our Graphics object with the new bitmap. graphics = graphics.FromImage(barCode) 'Make the Graphic object's drawing surfact white. graphics.Clear(System.Drawing.Color.White) 'Set the rendering hint to SingleBitPerPixel. graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixel 'Draw the string onto the Graphics object graphics.DrawString(dataIn, threeOfNine, New System.Drawing.SolidBrush(System.Drawing.Color.Black), 0, 0) 'Force the Graphics object to execute any pending operations. graphics.Flush() 'Dispose of our objects threeOfNine.Dispose() graphics.Dispose() 'Return the finished barcode. Return barCode End Function 'Creates a barcode image of the incoming data in a format suitable for storing in the database Public Function CreateBarcodeDBField(ByVal data As String) As Byte() Dim image As System.Drawing.Bitmap image = CreateBarcodeImage(data) 'Save to memory using the Gif format Dim ms As System.IO.MemoryStream = New System.IO.MemoryStream() image.Save(ms, System.Drawing.Imaging.ImageFormat.Gif) Dim imageBytes As Byte() = ms.GetBuffer() image.Dispose() ms.Close() ' read to end Return imageBytes End Function Public Function Fred as string Return "Fred" End Function ... |
|||
:
Нравится:
Не нравится:
|
|||
13.11.2015, 14:03 |
|
RS 2005: Вывод barcode
|
|||
---|---|---|---|
#18+
referances System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ... |
|||
:
Нравится:
Не нравится:
|
|||
13.11.2015, 14:06 |
|
|
start [/forum/topic.php?fid=31&msg=39102932&tid=1533305]: |
0ms |
get settings: |
12ms |
get forum list: |
13ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
31ms |
get topic data: |
11ms |
get forum data: |
2ms |
get page messages: |
42ms |
get tp. blocked users: |
1ms |
others: | 14ms |
total: | 132ms |
0 / 0 |