Graphics.DrawImage函数其中一种的用法
来源:互联网 发布:大学生分期软件 编辑:程序博客网 时间:2024/05/16 18:10
原型
Status DrawImage(IN Image* image,
IN const RectF& destRect,
IN REAL srcx,
IN REAL srcy,
IN REAL srcwidth,
IN REAL srcheight,
IN Unit srcUnit,
IN const ImageAttributes* imageAttributes = NULL,
IN DrawImageAbort callback = NULL,
IN VOID* callbackData = NULL)
使用图片加载并绘制图片的一部分
Image* pImage=Gdiplus::Image::FromFile(L"c:\\small.png");
RectF grect;
// grect.X=m_rcRect.left, grect.Y=m_rcRect.top; grect.Width = (int)(nStringWidth*g_dbDpi); grect.Height = (int)(iHeight*g_dbDpi);
grect.X= 450;
grect.Y=500;
RectF grect;
// grect.X=m_rcRect.left, grect.Y=m_rcRect.top; grect.Width = (int)(nStringWidth*g_dbDpi); grect.Height = (int)(iHeight*g_dbDpi);
grect.X= 450;
grect.Y=500;
int iWidth = pImage->GetWidth()/4;
int iHeight = pImage->GetHeight();
int iHeight = pImage->GetHeight();
grect.X= 600;
grect.Y=500;
grect.Width=200;
graphics.DrawImage(pImage, grect, iWidth*0,0,100,iHeight, UnitPixel);
grect.Y=500;
grect.Width=200;
graphics.DrawImage(pImage, grect, iWidth*0,0,100,iHeight, UnitPixel);
此处可以看出,在RectF中确定的width是画出的图片的实际宽度,而参数srcwidth是加载图片的宽度,如果加载的图片宽度小于实际的宽度就会进行加长填充,反之则会压缩加载图片
0 0
- Graphics.DrawImage函数其中一种的用法
- Graphics::DrawImage()函数的使用
- GDI+中Graphics::DrawImage的BUG
- C#Graphics.DrawImage的一些问题
- QPainter::drawImage的用法说明
- 利用 Graphics 的 DrawImage 生成高质量的缩略图。
- 【索引函数】的一种用法
- 函数指针的一种用法
- 还在为 Graphics.DrawImage 速度慢的问题发愁吗,请看这里
- Directgraphics.drawImage 和Graphics.drawRegion在不旋转情况下绘图速度的比较
- Winform画背景图片的两种方法TextureBrush与Graphics.DrawImage()
- [ATL/WTL]_[初级]_[关于graphics.DrawImage绘图时显示不正常的问题]
- 一种取多引脚的函数用法
- [C#] Graphics.DrawImage 图像质量变差
- sscanf函数用法 和其中的正则表达式
- 递归函数的用法,其中refresh()和SelectMenu()为递归
- C# DrawImage函数
- HTML5之drawImage函数
- 修改密码后退回到登录界面,再按返回键退出应用,关闭所有的Activity
- HDU 4190 Distributing Ballot Boxes
- java 泛型
- HttpClient--HttpClient的Get请求方式
- 50道Java编程基础题
- Graphics.DrawImage函数其中一种的用法
- java 单播、广播、组播
- Unity3D游戏开发之分页效果在uGUI中的实现
- ProgressBar控件入门
- Rails -- 中文字符串截取的函数
- android listview setEmptyview(设置listview是空值需要显示的布局)
- esri/dijit/Directions:计算方向
- @class @synthesize 的作用
- JAVA对快速排序的实现,简单易懂