Advertisement

07.12.2008 at 02:10PM PDT, ID: 23560042
[x]
Attachment Details

Dithered Gif images created by .Net

Asked by astromex in .NET Framework 3.x versions, Web Graphics Software, Microsoft Visual C#.Net

Tags: .Net, C#, IE7 / Firefox

I am dynamically creating images in .Net 3.0, but each format is giving me problems.
- When I save as Gif, the image is (I think the term is) 'ditherered'
- When I save as Png, it looks great in Firefox but in IE7 the colours ae not correct (for example in IE7 renders #CD5C5C as #C75151 - compare attached file in FF and IE).

So I either need the gif to be non-dithered, or the Png to work in IE - ideally a solution for both would be great.
ThanksStart Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
// Creates a square with a circle in the middle.
Bitmap tn = new Bitmap(30, 30);
Graphics gForm = Graphics.FromImage(tn);
 
gForm.CompositingMode = CompositingMode.SourceOver;
gForm.CompositingQuality = CompositingQuality.HighQuality;
gForm.SmoothingMode = SmoothingMode.HighQuality; ;
 
// Draw the background.
Brush BackBrush = new SolidBrush(Color.IndianRed);
gForm.FillRectangle(BackBrush, 0, 0, tn.Height, tn.Width);
BackBrush.Dispose();
 
Brush FillBrush = new SolidBrush(Color.BlueViolet);
gForm.FillEllipse(FillBrush, 10, 10, 10, 10);
FillBrush.Dispose();
 
tn.Save(OutputFolder + @"test.jpg", ImageFormat.Jpeg); //too blury!
tn.Save(OutputFolder + @"test.Gif", ImageFormat.Gif); // too dithered!
tn.Save(OutputFolder + @"test.Png", ImageFormat.Png); // IE7 problem!
Attachments:
 
Gif version of image.
Gif version of image.
 
 
Png version of image.
Png version of image.
 
[+][-]07.12.2008 at 04:12PM PDT, ID: 21990669

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.12.2008 at 04:20PM PDT, ID: 21990688

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.12.2008 at 04:35PM PDT, ID: 21990720

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.12.2008 at 05:16PM PDT, ID: 21990824

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.12.2008 at 05:20PM PDT, ID: 21990840

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.12.2008 at 06:08PM PDT, ID: 21990951

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.14.2008 at 06:32AM PDT, ID: 21997853

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.14.2008 at 09:46AM PDT, ID: 21999726

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.14.2008 at 10:28AM PDT, ID: 22000151

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: .NET Framework 3.x versions, Web Graphics Software, Microsoft Visual C#.Net
Tags: .Net, C#, IE7 / Firefox
Sign Up Now!
Solution Provided By: jaime_olivares
Participating Experts: 2
Solution Grade: A
 
 
[+][-]07.14.2008 at 10:30AM PDT, ID: 22000170

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.14.2008 at 12:06PM PDT, ID: 22000995

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.15.2008 at 11:33AM PDT, ID: 22009569

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.15.2008 at 12:06PM PDT, ID: 22009966

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.16.2008 at 11:13AM PDT, ID: 22018609

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.17.2008 at 11:30AM PDT, ID: 22028539

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628