当前注册人数422581人 邮箱: 密码: 注册新用户 忘记密码
首页 C/C++/MFC C# ASP.NET VB.NET MATLAB Android   站内搜索 下载代码说明/积分规则
为什么要注册?

1. 可以直接免费从本站下载代码,防止邮件发送不到您的邮箱,或登录不了国外网站

2. 可以设定关键字,当有您关心的代码收录时,邮件通知您

3. 对这里的代码进行评分和评论

4. 可以和大家一起分享你的源代码,得到更多的建议

A C# Sample Code/Article Extending the Capabilities of GDI+ in C# (.NET)

C#中支持选择区域图片的GDI+源代码

2007年12月12日
C#, .NET, WinXP, VistaVS2005, Dev
C#中的GDI+有一个很大的缺陷,那就是不能够想MFC中一样,选择图像中的一个区域,本程序给你解决这个问题。最主要是通过pInvoke调用DrawDragRect系统API。
相关知识

Inside the CDrawDragRect class the function void DrawDragRect(MouseEventArgs e) is the one responsible for this feature. This is called in response to the OnMouseMove(MouseEventArgs e) event of the form. As one can see, Win32 APIs (through pInvoke) are generously used in the implementation of this feature.

The DrawDragRect(MouseEventArgs e) API first goes on to create 4 Windows regions:

  • rgnOld
  • rgnNew
  • rgnDiff
  • rgnDiffOld

源代码原文下载:
A C# Sample Code/Article Extending the Capabilities of GDI+ in C# (.NET) In imaging applications like Adobe's Photoshop, Google's Picasa or Coral's Paint Shop Pro, there is always a need to select a part of image. Maybe the user wants to enlarge a section of image, or maybe the user wants to process a selected region of an image (see Figure 1 below). Imaging applications which are written/ported to .NET language like C# are at a great loss as there is no DrawDragRect (…) API in C# or other .NET Languages. The problem is compounded, as there is no Win32 API that can be used through pInvoke, (a commonly used technique to invoke win32 APIs from .NET languages). This paper gives an implementation of the DrawDragRect (…) API written in C# that can be incorporated very easily into your C# forms programs or any other .NET form based programs.

源码图片

点击链接查看大图
从本站下载附件及源代码(1个附件,已经成功下载467次)

最值得关注的外文源代码

Generic TCP/IP Client/Server
Graphical data selection tool
SuperGrid - Yet Another listview control
Owner-draw icon buttons in plain C (no MFC)
评论(评论是增加积分的一个有效途径)
字数在300字内
请如实评论
本源代码共评论80次,此处显示最近20次评论! 查看所有评论

xiaoyasheng  2015年04月15日
很好
shuaike  2015年01月27日
好资源,可以供学习,多谢分享
蓝色月光  2014年11月04日
可以啊
Goddess  2014年08月01日
正好需要啊,感谢
gs08  2014年05月12日
非常好的资料
troy  2013年12月10日
分数总不够
lamborghini  2013年04月29日
遁去的一叶  2012年12月04日
学习了
雷少敏  2012年11月03日
比较经典
小美  2012年09月15日
不错,谢谢
dzhl  2012年08月07日
不错,正用到
aguoit  2012年06月12日
经典算法!
sun  2012年03月07日
谢谢
asdf7983  2012年02月07日
最近在学习如何截图呢 很好
rocky69  2011年12月02日
正需要喔
vivian  2011年11月05日
thanks
feifei  2011年05月12日
谢谢!
云的预言  2011年04月03日
学习学习
aanb122  2010年12月23日
这个真行么 看看
leiryhp  2010年12月03日
C#中支持选择区域图片的GDI+源代码
字数在300字内
请如实评论
200万国内源码搜索
CopyRight (C) codesoso.com 2007-2009 All Rights Reserved zhihuishi   免责声明