开发者

bit map scaling

I have bitmap of 24*24 pixels, I want to res开发者_StackOverflowize the bitmap dynamically 48*48 pixels or 5*5 pixels. How to do this with out losing the information


You could try something like this

Bitmap bm = new Bitmap(@"C:\Test1.bmp");
Bitmap result = new Bitmap(48, 48); 
using (Graphics g = Graphics.FromImage(result))
    g.DrawImage(bm, 0, 0, 48, 48);
result.Save(@"C:\Test2.bmp");

Typically scaling/Resizing images does change the quality of the new image...


You will lose information. To give the impression you are not losing as much information you need to use anti-aliasing. Iterate over the original image and consolidate the pixels which will become one pixel in your final image by taking the average of their colours.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜