![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi I have now spent the better part of two days trying to solve this problem, and really hope somebody here can help me. When i resize an image, and use antialias, I lose important image information. This is the code: [code] Dim scale_factor As Single = 0.25 'scale to 1/4 size Dim bm_source As New Bitmap(New System.Drawing.Bitmap(TextBox1.Text)) Dim bm_dest As New Bitmap(CInt(bm_source.Width * scale_factor), CInt(bm_source.Height * scale_factor)) Dim gr_dest As Graphics = Graphics.FromImage(bm_dest) 'gr_dest.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQua lityBicubic gr_dest.DrawImage(bm_source, 0, 0, bm_dest.Width, bm_dest.Height) bm_dest.Save("C:\Temp\ResizeProbs\Out.jpg", System.Drawing.Imaging.ImageFormat.Jpeg) bm_dest = Nothing [end code] This is the source-image i created for testing purposes: http://agilator.dk/newsimages/source.jpg Notice the 4 pixel border all the way around the image. When I leave the interpolation out (the line commented out) the image comes out ugly, but with the right size borders: http://agilator.dk/newsimages/Out_NoAntialias.jpg When I enable interpolationmode and set it to HighQualityBicubic (or other quality modes, I tried them all), the border is still displaed ok at the top and on the left side. At the bottom and the right side, however, the border has a different size. Check out the image: http://agilator.dk/newsimages/Out_Antialias.jpg This seems like a tiny detail, but when resizing images with borders to thumbnails, it looks like there is only a border at the top and on the left side - so it basicly looks wrong. How can I solve this? Any help will be greatly appreciated! Thanks in advance - Klaus Jensen, MCAD |
#3
| |||
| |||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |