resizing transparent images is quite tricky, because resampling doesn't keep color values intact. You've discovered that already.
I think the best way to do this would be to use a truecolor image and alpha channel, and only convert to transparent image at the end, after resizing with resample. This would have the desired effect, because you must be aware of the fact that even if you successfully resized a transparent image, the pixels that lay on the edge of the border will be background-ish (white-ish in your case) due to mixing white pixels with border pixels. These pixels wouldn't be neither border-color nor white. So if you'd then merge this image onto a background, that white artifacts will be very visible, unless the background itself is white (which it isn't, otherwise you wouldn't care about transparency).
Or, if not that, you can use 24-bit pngs if you don't mind the fact that IE6 doesn't support them.
But, anyhow, do you mind posting your code so I can take a look? I have some experience with resizing, because I've managed to handle it in my image library (see my sig). It doesn't support drawing, but maybe you'd find it useful.
regards
|