在windows下vc++6.0中实现图片加载,放大功能。
图片有可能是jpg格式,放在本地计算机上。根据路径。
图片有可能是jpg格式,放在本地计算机上。根据路径。
解决方案 »
- 从键盘输入至应用程序窗口屏幕呈现,一个汉字的编码转换过程?
- visual c++的语句是不是在mfc里面也通用的?
- 请问:为什么我对图片旋转后图片无法正常显示?
- activex 下载警告问题
- ******请教一个按钮的问题,也许你没想到过,过来看看。。。。。。。。。。。
- chenwhenlong(needway) 请进
- 关于ActiveForm和Timer的问题(高分)
- 如何在简体操作系统中显繁体汉字?up者有分!解决问题者还可以另开贴给分!
- arx for autocad14和VC6开发的arx用在AutoCad2000中??
- 紧急求救!恳请高人救救我!(一个莫名其妙的异常)不胜感激!!!!
- 请教listview的缩略图是以什么类型存放在什么地方?
- 如何用vc写出能够连接asp服务器的程序?
atlimage.h?vc6.0不支持阿,怎么添加。把你的 发来,给分。
谢谢大家
void CTestGdi2Dlg::OnButton1()
{
// TODO: Add your control notification handler code here
HDC hdc;
Graphics graphics(hdc);//不知道怎么 用graphics
Image image(L"110.jpg");
Status status = image.GetLastStatus();
if(Ok != status)
{
MessageBox("错误status");
return ;
} UINT width1 = image.GetWidth();
UINT height = image.GetHeight();
// Make the destination rectangle 30 percent wider and
// 30 percent taller than the original image.
// Put the upper-left corner of the destination
// rectangle at (150, 20).
Rect destinationRect(150, 20, 1.3 * width1, 1.3 * height);
// Draw the image unaltered with its upper-left corner at (0, 0).
status = graphics.DrawImage(&image, 0, 0);
if(Ok != status)
{
MessageBox("错误status"); return ;
}
// Draw a portion of the image. Scale that portion of the image
// so that it fills the destination rectangle.
status = graphics.DrawImage(
&image,
destinationRect,
0, 0, // upper-left corner of source rectangle
0.75 * width1, // width of source rectangle
0.75 * height, // height of source rectangle
UnitPixel);
if(Ok != status)
{
MessageBox("错误status");
return ;
}
}那位大虾给改下,有好多问题。谢谢