[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

igkins

12/5/2004 8:19:00 PM

Hello,

I have the following code:

image = createImage(sType)
image.SetResolution(300, 300)
g = Graphics.FromImage(image)
textFont = New Font(fontFace, 8.0F, FontStyle.Bold)
g.DrawString(sText, textFont, New SolidBrush(fontColor), _
New RectangleF(outRect.X, outRect.Y,
outRect.Width, _
(inRect.Y - outRect.Y)), format)

Before, I wasn't setting the resolution and the image came out crappy.
After I added the code to SetResolution a little higher, the text looks a lot
better, but its a lot larger is well? Why is that?
1 Answer

Bob Powell

12/6/2004 12:16:00 AM

0

I suspect that you're viewing the bitmap with something like Paint which
doesn't take any notice of the resolution.

An image with higher resolution will indeed require more pixels to create
text of a certain size. This is expected.

Try using the image viewer.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tips...

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/f...

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.





"igkins" <igkins@discussions.microsoft.com> wrote in message
news:97A0ECC7-487A-4F51-9E90-4197B815950A@microsoft.com...
> Hello,
>
> I have the following code:
>
> image = createImage(sType)
> image.SetResolution(300, 300)
> g = Graphics.FromImage(image)
> textFont = New Font(fontFace, 8.0F, FontStyle.Bold)
> g.DrawString(sText, textFont, New SolidBrush(fontColor), _
> New RectangleF(outRect.X, outRect.Y,
> outRect.Width, _
> (inRect.Y - outRect.Y)), format)
>
> Before, I wasn't setting the resolution and the image came out crappy.
> After I added the code to SetResolution a little higher, the text looks a
lot
> better, but its a lot larger is well? Why is that?