请教GDI+实现图形的缩放,显示程序4(100分)!assert1,我说话算数!

construct 2004-01-13 03:46:24
原贴:请教GDI+实现图形的缩放,显示程序 (construct )
http://expert.csdn.net/Expert/topic/2631/2631453.xml?temp=.4543573
请斑竹大人通融一下,等我的问题解决了(顶多三天)就结贴
assert1,我说话算数!
...全文
81 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
dfliu 2004-01-14
  • 打赏
  • 举报
回复
可以利用映射模式实现缩放。
SetMapMode()中可以选择映射方式,还有其他函数辅助选择窗口坐标和设备坐标之间的关系
可以在MSDN查找相关说明。
arvid_gs 2004-01-14
  • 打赏
  • 举报
回复
Scaling Images
You can use the DrawImage method of the Graphics class to draw and position images. DrawImage is an overloaded method, so there are several ways you can supply it with arguments. One variation of the DrawImage method receives the address of an Image object and a reference to a Rectangle object. The rectangle specifies the destination for the drawing operation; that is, it specifies the rectangle in which the image will be drawn. If the size of the destination rectangle is different from the size of the original image, the image is scaled to fit the destination rectangle. The following example draws the same image three times: once with no scaling, once with an expansion, and once with a compression.

Bitmap myBitmap(L"Spiral.png");
Rect expansionRect(80, 10, 2 * myBitmap.GetWidth(), myBitmap.GetHeight());
Rect compressionRect(210, 10, myBitmap.GetWidth() / 2,
myBitmap.GetHeight() / 2);

myGraphics.DrawImage(&myBitmap, 10, 10);
myGraphics.DrawImage(&myBitmap, expansionRect);
myGraphics.DrawImage(&myBitmap, compressionRect);
arvid_gs 2004-01-14
  • 打赏
  • 举报
回复
http://www.vckbase.com/document/viewdoc.asp?id=451
asett1 2004-01-14
  • 打赏
  • 举报
回复
可以回复了! ^_^
昨晚10点就发给你了,看看有啥问题
asett1 2004-01-14
  • 打赏
  • 举报
回复
//抱歉很忙,原来是设定更改jpeg质量的,忘记删除了

//鼠标拖动图像,即pan view,就是得到鼠标移动距离,再让滚动条移动位置就行了



//GDIplusImageDoc.cpp 173行 的 &encoderParameters 改为NULL

//即用默认的jpeg质量.更改如下:



Status last = m_pImage->Save(ToWChar

(strFileSave.GetBuffer(strFileSave.GetLength())),

&clsid, NULL);

19,469

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 图形处理/算法
社区管理员
  • 图形处理/算法社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧