ASP.NET Image Resizing

T

Thomas

Hi all,

I've written an image resizing class so that I can generate thumbnails
and various image sizes on the fly.

The problem I'm having is that on about 70% of the thumbnails I
generate, I can see a 1 pixel border around the left and top edge.
Not a huge deal but it's aggravating. Not sure what was causing it, I
searched the net for code samples. Using code very similar to:
http://www.codeproject.com/csharp/imageresize.asp

(I tried this code, too, and get similar results.)

Before I call DrawImage and save the new file, I added the following:

SolidBrush sb = new SolidBrush(System.Drawing.Color.Red);
graphic.FillRectangle(sb,destX,destY,destWidth,destHeight);

Sure enough, the left and top border is a 1 pixel red color, about 30%
transparent if I had to guess. I've stepped through the code and the
dimensions are all 100% correct.

Any ideas on how to fix this? Note that not all thumbnails I generate
are affected by this. I do have all the settings set to high quality.

Thanks,
Tom
 
T

Thomas

OK! I discovered that if I use a different filter (not
HighQualityBicubic) the problem disappears. Unfortunately, the other
results are pretty bad in terms of quality. Ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top