473,513 Members | 2,709 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Text on Image Resolution

I create a .PNG image ( in Macromedia Fireworks ) which has an gif in
it in the top left corner and a lot of empty canvas space to the right.

I use about 10 text boxes on a form to populate that empty space with
text.

I then print the image ( from a picture box on my form) on a UPS
Thermal Printer ( label printer)

Problem is the resolution of the text is blurry.

I tried changing the image resolution but that made it print very
small.

I dont know if I should try a differnt image type other then .png.

The PC that prints the label is running XP. The below code is what
creates the image and prints it:
Private Sub btnMakeLabel_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button1.Click
Dim imageName As String = "C:\Projects\Vitex\VPG_Small_3.png"
Dim i As Image = Image.FromFile(imageName)
Dim g As Graphics = Graphics.FromImage(i)
Dim sf As StringFormat =
CType(StringFormat.GenericTypographic.Clone(), StringFormat)
sf.Alignment = StringAlignment.Center
sf.LineAlignment = StringAlignment.Center
Dim dt As Date =
Date.Parse(Me.MonthCalendar1.SelectionRange.Start)
Dim lblMonth As Integer = dt.Month
Dim lblDay As Integer = dt.Day
'g.TextRenderingHint =
Drawing.Text.TextRenderingHint.AntiAliasGridFit
g.DrawString(lblMonth.ToString() + " " + lblDay.ToString(), New
Font("Helvetica", 9, GraphicsUnit.Pixel), Brushes.Black, New
RectangleF(65, 49, 50, 25), sf)
'g.DrawString("Set # ", New Font("Helvetica", 7,
GraphicsUnit.Point), Brushes.Black, New RectangleF(50, 34, 50, 25), sf)
g.DrawString(Me.txtSet.Text + "", New Font("Helvetica", 9,
GraphicsUnit.Pixel), Brushes.Black, New RectangleF(48, 49, 50, 25), sf)
g.DrawString(Me.txtBackroll.Text, New Font("Helvetica", 9,
GraphicsUnit.Pixel), Brushes.Black, New RectangleF(38, 49, 50, 25), sf)
g.DrawString("Op: " + Me.txtOperatorInitls.Text, New
Font("Helvetica", 9, GraphicsUnit.Pixel), Brushes.Black, New
RectangleF(5, 50, 50, 25), sf)
g.DrawString("Code: " + Me.txtCode.Text, New Font("Helvetica",
9, GraphicsUnit.Pixel), Brushes.Black, New RectangleF(38, 2, 100, 25),
sf)
g.DrawString("SO: " + Me.txtS0.Text, New Font("Helvetica", 9,
GraphicsUnit.Pixel), Brushes.Black, New RectangleF(155, 1, 60, 25), sf)
g.DrawString("Desc:" + Me.txtDescript1.Text, New
Font("Helvetica", 9, GraphicsUnit.Pixel), Brushes.Black, New
RectangleF(40, 12, 120, 25), sf)
g.DrawString(Me.txtDescript2.Text, New Font("Helvetica", 9,
GraphicsUnit.Pixel), Brushes.Black, New RectangleF(49, 22, 120, 25),
sf)
g.DrawString("PO: " + Me.txtPurchOrd.Text, New
Font("Helvetica", 9, GraphicsUnit.Pixel), Brushes.Black, New
RectangleF(38, 34, 80, 25), sf)
g.DrawString("Qty: " + Me.txtPressRepeats.Text, New
Font("Helvetica", 9, GraphicsUnit.Pixel), Brushes.Black, New
RectangleF(127, 17, 90, 60), sf)
g.DrawString("Roll # 1", New Font("Helvetica", 9,
GraphicsUnit.Pixel), Brushes.Black, New RectangleF(107, 30, 120, 60),
sf)
g.Dispose()
Me.PictureBox1.Image = i
End Sub
Private Sub btnPrintLabels_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button2.Click
Try
'If you do not specify a printer it uses the default
'Me.PrntDoc_Img.PrinterSettings.PrinterName = "Canon
MF3110"
Me.PrntDoc_Img.DocumentName = "Vitex Label"
AddHandler PrntDoc_Img.PrintPage, AddressOf Me.pd_PrintPage
PrntDoc_Img.Print()
Catch ex As Exception
MessageBox.Show("An error occurred while printing", _
ex.ToString())
End Try

End Sub
' Specifies what happens when the PrintPage event is raised.
Private Sub pd_PrintPage(ByVal sender As Object, ByVal ev As
System.Drawing.Printing.PrintPageEventArgs)
' Draw a picture.
'ev.Graphics.
ev.Graphics.DrawImage(Me.PictureBox1.Image, _
ev.Graphics.VisibleClipBounds.Location)

' Indicate that this is the last page to print.
ev.HasMorePages = False
End Sub
End Class

Anything I can do to increase the text quality.

Mar 15 '06 #1
0 1623

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

Similar topics

8
2435
by: Chris Beall | last post by:
I'm struggling with how to handle, on a web page, images that contain text that the user must be able to read. Examples: tombstone photos, photos or scans of historic documents (handwritten or...
2
2163
by: Ben Amada | last post by:
Hi group. I'm going to display a low resolution image in an HTML page. On the web server, I have a high resolution version of that image. If I display the high resolution image in the browser...
3
2749
by: UJ | last post by:
My client wants to have some text scale appropriately depending on the resolution of the screen. This is very much like the way that flash works in that as the area being displayed gets bigger, the...
7
3288
by: Yeah | last post by:
Ever since I upgraded my Windows display to 120 DPI (kind of a necessary change), fonts have been clearer and graphics have been crisper. However, the 25% automatic increase in the text size on my...
14
3962
by: Roger Withnell | last post by:
How to I find out what size text the browser is set to? Thanks in anticipation.
4
2117
by: CG3000 | last post by:
I create a .PNG image ( in Macromedia Fireworks ) which has an gif in it in the top left corner and a lot of empty canvas space to the right. I use about 10 text boxes on a form to populate...
3
2582
by: Andy Baxter | last post by:
I have an image scrolling in a viewport for a panoramic image viewer. The viewport can be resized to several set resolutions so people can adjust the size according to their bandwidth. There are...
3
2481
by: =?Utf-8?B?SlIx?= | last post by:
I would like to add text to an image. I have tried to use DrawString and it works on some images but on others it is very very small. I am pretty sure it has something to do with the size of the...
6
7487
by: bradyounie | last post by:
I'm writing a program that displays a user-supplied Bitmap and then writes text fields to it. These "text fields" are things that the user can move around on the image, but to render them...
0
7153
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7373
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7432
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7094
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7519
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5079
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3230
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
796
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.