c#基于windows的应用程序 [英] c# windows based application

查看:67
本文介绍了c#基于windows的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有一个图片框,然后我想选择图像的一个区域。该区域应该用虚线矩形覆盖。



现在我想按一下按钮裁剪这个选定的图像。



向我发送代码来执行此操作。

Suppose I have a picture in picture box and then I would like to select an area of the image. That area should be covered by dotted rectangle.

Now I would like to crop this selected image on a button click.

Please send me code to do this.

推荐答案

Crop从Windows窗体图像 [ ^ ]应该很容易帮到你。



这里有几篇文章/讨论同样 -

http://www.c-sharpcorner.com/Forums/Thread/163983/crop-area-selection-controllike-photoshops-in-C-Sharp-windows.aspx [ ^ ]

http://go4answers.webhost4life.com/Example/screen-capture-cropping-46732.aspx [ ^ ]
The code and sample available at Crop the image from Windows Forms [^] should easily help you.

There are a couple of articles / discussions available here as well -
http://www.c-sharpcorner.com/Forums/Thread/163983/crop-area-selection-controllike-photoshops-in-C-Sharp-windows.aspx[^]
http://go4answers.webhost4life.com/Example/screen-capture-cropping-46732.aspx[^]


你需要处理

图片框'mousedown,mousemove,mouseup的事件

捕获鼠标点击和拖动的动作。

C#PictureBox MouseDown MouseUp [ ^ ]



关于绘制一个矩形。

C#绘制矩形 [ ^ ]



关于裁剪并调整图像大小:

使用裁剪和调整大小同时保持宽高比的简单图像编辑器 [ ^ ]

易于使用的图像大小调整和裁剪控制 [ ^ ]
You need to handle
picture box''s event of mousedown, mousemove, mouseup
which capture the action of mouse click and dragging.
C# PictureBox MouseDown MouseUp[^]

about drawing a rectangle.
C# Draw Rectangle[^]

About crop and resize image:
Simple Image Editor with Crop and Resize while Maintaining Aspect Ratio[^]
An Easy to Use Image Resizing and Cropping Control[^]


这篇关于c#基于windows的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆