我试图调整在asp.net的Visual Studio V2008的图像,C#
调整基于设备上的宽度图像和高度
using (Graphics newgraphics = Graphics.FromImage(myBackgroundImage))
{
newgraphics.Clear(Color.FromArgb(-1));
if ((float)oldbmp.Width/(float)Width == (float)oldbmp.Height/(float)Height)
{
newgraphics.DrawImage(oldbmp, 0, 0, Width, Height);
}
}
我已经进入了上面的代码,但我得到了以下错误建立。
Graphic.DrawImage被重载。它期望,int,int,矩形,graphicsunit
任何人有任何建议吗?
非常感谢
瑞秋
嗨Jundev,你是什么意思由0.0F而不是0? – Rachsherry
基本上发生的事情是,我正在运行移动应用程序,并且当设备屏幕尺寸发生变化时(原始尺寸为240 * 268(宽*高),新设备为480 * 536。图像未调整大小以适合新设备 – Rachsherry
这里是已经存在的代码 – Rachsherry