开发者

C# Drawing scaled Images JPG, PNG using DrawImage does not look correct

I am trying to Draw an Image (JPG, TIFF, PNG) on the background of my user control. My user control will highlight certain portions of the Image using Rectangles. If I draw the image unscaled they are looking correct. But when I draw then Scaled [Fit to Page] then the image is not looking correct. For PNG s开发者_如何学编程ome times it fails to load the image even.

The application is not a image processing app but I still want to show the Image scaled and can see the image properly.

Thanks --HAN


Before Drawing int he paint event I have added the following

        e.Graphics.SmoothingMode = SmoothingMode.HighQuality;
        e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
        e.Graphics.PixelOffsetMode = PixelOffsetMode.HighQuality; 

Then the images looked alright.

Thanks for your comments.

--Hari

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜