SS_NN
asked on
C# wants to save Bitmap to High resolution
HEllo All,
I need a help to save drawn image to some good resolution.
I am drawing My project related Graphs on C# Form using Drawline,drawsrtring etc.....
Up to hee it wwas fine. i am able to see the drawn image on Form with good resolution.
Now i need to save this "Graph image: to .jpeg format.when i am saving this the resolution is very low on the saved file.how can i overcome this problem? is there any solution to increase the Resolution of the image before saving.
Please help.....
code sample which i am using to save the image to file is
ImageFormat format = ImageFormat.JPEG ;
SaveFileDialog sfd = new SaveFileDialog();
sfd.Filter = JPEGFiles(*.jpg)|*.jpg";
if (sfd.ShowDialog() == DialogResult.OK)
{ // now save the image in the DrawArea
DrawArea.Save(sfd.FileName , format);
}
image.jpg
I need a help to save drawn image to some good resolution.
I am drawing My project related Graphs on C# Form using Drawline,drawsrtring etc.....
Up to hee it wwas fine. i am able to see the drawn image on Form with good resolution.
Now i need to save this "Graph image: to .jpeg format.when i am saving this the resolution is very low on the saved file.how can i overcome this problem? is there any solution to increase the Resolution of the image before saving.
Please help.....
code sample which i am using to save the image to file is
ImageFormat format = ImageFormat.JPEG ;
SaveFileDialog sfd = new SaveFileDialog();
sfd.Filter = JPEGFiles(*.jpg)|*.jpg";
if (sfd.ShowDialog() == DialogResult.OK)
{ // now save the image in the DrawArea
DrawArea.Save(sfd.FileName
}
image.jpg
ASKER
Hi rendaduiyan,
Thank you for your solution.but still i am not able to see good resolution one.....
battery.bmp
Thank you for your solution.but still i am not able to see good resolution one.....
battery.bmp
it would be better if I can see your code.
I think it is the way you draw those strings that makes you think they are not in good resolution.
can you change the font, background and foreground color?
Or what the size of your area? what the font size?
I think it is the way you draw those strings that makes you think they are not in good resolution.
can you change the font, background and foreground color?
Or what the size of your area? what the font size?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thnkas for your solution. i was able to see the grpah with good resolution.
with the above code snippet i have increased the thickness of the line.
Thanks you verymuch for your help.
with the above code snippet i have increased the thickness of the line.
Thanks you verymuch for your help.
Graphics g = Graphics.FromImage(b);
b.SetResolution(img.Horizo
g.SmoothingMode = System.Drawing.Drawing2D.S
g.InterpolationMode = System.Drawing.Drawing2D.I
b.Save(filename, ImageFormat.Jpeg);
From the example, you can see you need decide the color resolution when creating bitmap
and then resolution at two direction for graph.
try it.