473,395 Members | 1,653 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,395 software developers and data experts.

Saving Bitmaps

I'm trying to use GDI+ and C# to draw some text and then save to a bitmap
file. When I open a bmp file that I have saved it looks terrible. I have
tried playing with different settings but no matter what I do it looks like
the resolution is set very low. Is this the way it is or am I missing
something.
Nov 16 '05 #1
4 2630
Can you post some code?

"NetNav" wrote:
I'm trying to use GDI+ and C# to draw some text and then save to a bitmap
file. When I open a bmp file that I have saved it looks terrible. I have
tried playing with different settings but no matter what I do it looks like
the resolution is set very low. Is this the way it is or am I missing
something.

Nov 16 '05 #2
Here is the code that I use.

Brush b = new SolidBrush(Color.Black);
Font f = new Font("verdana", 10);
Bitmap bmp = new Bitmap(300,200);
Graphics g = Graphics.FromImage(bmp);
g.Clear(Color.White);
g.DrawString("hello world", f, b, new Point(10,10));
bmp.Save(@"C:\test.bmp", ImageFormat.Bmp);
g.Dispose();

When I open test.bmp it looks terrible. How do I make it so the saved bmp
is of acceptable quality.

"tom wisnowski" wrote:
Can you post some code?

"NetNav" wrote:
I'm trying to use GDI+ and C# to draw some text and then save to a bitmap
file. When I open a bmp file that I have saved it looks terrible. I have
tried playing with different settings but no matter what I do it looks like
the resolution is set very low. Is this the way it is or am I missing
something.

Nov 16 '05 #3
try setting the textrenderinghint to anti-aliasing

NetNav <Ne****@discussions.microsoft.com> wrote in message news:<74**********************************@microso ft.com>...
Here is the code that I use.

Brush b = new SolidBrush(Color.Black);
Font f = new Font("verdana", 10);
Bitmap bmp = new Bitmap(300,200);
Graphics g = Graphics.FromImage(bmp);
g.Clear(Color.White);
g.DrawString("hello world", f, b, new Point(10,10));
bmp.Save(@"C:\test.bmp", ImageFormat.Bmp);
g.Dispose();

When I open test.bmp it looks terrible. How do I make it so the saved bmp
is of acceptable quality.

"tom wisnowski" wrote:
Can you post some code?

"NetNav" wrote:
I'm trying to use GDI+ and C# to draw some text and then save to a bitmap
file. When I open a bmp file that I have saved it looks terrible. I have
tried playing with different settings but no matter what I do it looks like
the resolution is set very low. Is this the way it is or am I missing
something.

Nov 16 '05 #4
I have played with the textrenderinghint settings with no luck. If you run
the simple code described earlier on your computer how does it look?

"chris m" wrote:
try setting the textrenderinghint to anti-aliasing

NetNav <Ne****@discussions.microsoft.com> wrote in message news:<74**********************************@microso ft.com>...
Here is the code that I use.

Brush b = new SolidBrush(Color.Black);
Font f = new Font("verdana", 10);
Bitmap bmp = new Bitmap(300,200);
Graphics g = Graphics.FromImage(bmp);
g.Clear(Color.White);
g.DrawString("hello world", f, b, new Point(10,10));
bmp.Save(@"C:\test.bmp", ImageFormat.Bmp);
g.Dispose();

When I open test.bmp it looks terrible. How do I make it so the saved bmp
is of acceptable quality.

"tom wisnowski" wrote:
Can you post some code?

"NetNav" wrote:

> I'm trying to use GDI+ and C# to draw some text and then save to a bitmap
> file. When I open a bmp file that I have saved it looks terrible. I have
> tried playing with different settings but no matter what I do it looks like
> the resolution is set very low. Is this the way it is or am I missing
> something.
>
>

Nov 16 '05 #5

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

Similar topics

4
by: Michael Kennedy [UB] | last post by:
Hi Everyone, I have this multithreaded C# windows forms application which does a lot of image processing. Occasionally, I get the following error: A generic error occurred in GDI+....
4
by: dale zhang | last post by:
Hi, I am trying to save and read an image from MS Access DB based on the following article: http://www.vbdotnetheaven.com/Code/Sept2003/2175.asp Right now, I saved images without any...
3
by: Dennis | last post by:
Will 2005 allow saving bitmaps containing >256 colors using the .save method? -- Dennis in Houston
3
by: Michael Kennedy [UB] | last post by:
Hi Everyone, I have this multithreaded C# windows forms application which does a lot of image processing. Occasionally, I get the following error: A generic error occurred in GDI+....
2
by: Mark Denardo | last post by:
Hi, I need some expert GDI+ person to help me with my RoundOffImage Function: What I'm trying to do is take in an image, crop off the edges around an ellipse region I set up, and then return the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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
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
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...
0
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
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...

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.