I have also played around with System.Drawing.Graphics. Can anyone tell me
the optimum settings to get the best looking image with these?
With objGraphics
.CompositingMode = Drawing2D.CompositingMode.SourceOver
.CompositingQuality = Drawing2D.CompositingQuality.HighQuality
.SmoothingMode = Drawing2D.SmoothingMode.HighQuality
.InterpolationMode = Drawing2D.InterpolationMode.High
.PixelOffsetMode = Drawing2D.PixelOffsetMode.HighQuality
.DrawImage(objNewImage, 0, 0, 160, 120))
.Dispose()
End With
objImageBlank.Save(strNewFileName, System.Drawing.Imaging.ImageFormat.Jpeg)
objNewImage.Dispose()
Does the order matter? Also, what about these;
Graphics.TranslateClip
Graphics.ScaleTransform
They did some strange things, but I could not get the output I was looking
for. Any other suggestions would be appreciated.
Thanks,
Roger
Eric Gunnerson posted the following in response to one of my posts in
another group, which could explain the image quality problem you are seeing:
One quick note on GetThumbnailImage(). If your picture comes from a digital
camera, it may have an embedded thumbnail. If it does, GDI+ will take that
thumbnail and resize it to the size you ask for rather than create a new
one. If the size you want is bigger, it looks pretty bad.
HTH,
--
Jeff Rhodes
Author of "VBTrain.Net: Creating Computer and Web Based Training with Visual
Basic® .NET"
www.vbtrain.net
Home of the Shape and Graphical Text controls
"Roger" <roger...@hotmail.com> wrote in message
news:uHNmk2sLCHA.2452@tkmsftngp08...
You might want to do the scaling with Graphics.DrawImage and specify
"HighQualityBicubic" for the Interpolation Mode. Draw the image in a
"memory" Graphics object. Set the Interpolation Mode to HighQualityBicubic
before calling the Graphics.DrawImage method:
e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
Thanks,
-Greg
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.
Visit http://www.microsoft.com/security for current information on security.
--------------------
| From: "Roger" <roger...@hotmail.com>
| Subject: Graphics and resizing images better than Image.GetThumbnailImage
quality
| Date: Thu, 18 Jul 2002 21:40:53 -0500
| Lines: 39
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
| Message-ID: <uHNmk2sLCHA.2452@tkmsftngp08>
| Newsgroups: microsoft.public.dotnet.framework.drawing
| NNTP-Posting-Host: 12.238.222.48
| Path: cpmsftngxa08!tkmsftngp01!tkmsftngp08
| Xref: cpmsftngxa08 microsoft.public.dotnet.framework.drawing:2505
| X-Tomcat-NG: microsoft.public.dotnet.framework.drawing
Thanks,
Roger
"Greg Binkerd [MS]" <Gr...@online.microsoft.com> wrote in message
news:WkCZYOzLCHA.3204@cpmsftngxa07...
The following articles may help:
INFO: Determine the JPEG Quality Factor by Using Visual C# .NET
ID: Q324790
INFO: Determine JPEG Quality Factor by Using Visual Basic .NET
ID: Q324788
Thanks,
-Greg
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.
Visit http://www.microsoft.com/security for current information on security.
--------------------
| From: "Roger" <roger...@hotmail.com>
| References: <uHNmk2sLCHA.2452@tkmsftngp08> <WkCZYOzLCHA.3204@cpmsftngxa07>
| Subject: Re: Graphics and resizing images better than
Image.GetThumbnailImage quality
| Date: Fri, 19 Jul 2002 19:48:03 -0500
| Lines: 104
| X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
| Message-ID: <#7Kv2a4LCHA.2004@tkmsftngp10>
| Newsgroups: microsoft.public.dotnet.framework.drawing
| NNTP-Posting-Host: 12.238.222.48
| Path: cpmsftngxa07!tkmsftngp01!tkmsftngp10
| Xref: cpmsftngxa07 microsoft.public.dotnet.framework.drawing:2538
| X-Tomcat-NG: microsoft.public.dotnet.framework.drawing
-roger
"Greg Binkerd [MS]" <Gr...@online.microsoft.com> wrote in message
news:NDgRijZMCHA.2016@cpmsftngxa07...
> >
> > INFO: Determine the JPEG Quality Factor by Using Visual C# .NET
> > ID: Q324790
> >
> > INFO: Determine JPEG Quality Factor by Using Visual Basic .NET
> > ID: Q324788
Go to the KB search page and paste the ID number in the box at the top of
the far left column, or in the 'Search for...' box, or scroll down about 2/3rds
of the page and enter it in the box provided there (that's the more direct route).
KB Search page:
http://support.microsoft.com/default.aspx?scid=fh;en-us;kbinfo
LFS
eg:
System.Drawing.Image img = System.Drawing.Image.FromFile("myimg.jpg");
img.RotateFlip(RotateFlipType.Rotate180FlipNone);
img.RotateFlip(RotateFlipType.Rotate180FlipNone);
img.GetThumbnailImage(80, 80, null, new IntPtr());