在运行时将图像加载到“图像控制"框中后,图像质量下降 [英] After loading the images into Image Control box at runtime, the quality of image is decreasing

查看:60
本文介绍了在运行时将图像加载到“图像控制"框中后,图像质量下降的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我在运行时在vb6.0中将jpeg加载到图像控制"框中,但图像显示不正确(例如:在矩形框中,线条的3面未出现一侧未出现)我的图像尺寸为1100 X 850和图像盒子的高度和宽度是11850 X8775.

因此请执行需要的

Hi,
I am loading the jpeg into Image Control box at runtime in vb6.0, the image is not displaying correctly (for eg: in rectangle box 3 sides of lines are appearing one side is not appearing) my image dimensions are 1100 X 850 and image box height and width is 11850 X 8775.

so pls do the needful

推荐答案

使用以下代码尝试缩放功能:
Try the zoom functionality using the below code:
public Image PictureBoxZoom(Image img, Size size)
{
    Bitmap bm = new Bitmap(img, Convert.ToInt32(img.Width * size.Width), Convert.ToInt32(img.Height * size.Height));
    Graphics grap = Graphics.FromImage(bm);
    grap.InterpolationMode = InterpolationMode.HighQualityBicubic;
    return bm;
}


这篇关于在运行时将图像加载到“图像控制"框中后,图像质量下降的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆