如何在选择图像的某些区域时裁剪图像

发布于 2024-11-18 20:43:03 字数 36 浏览 2 评论 0原文

我想通过将图像拖动到图像上来选择图像的某些区域来裁剪图像。

I would like to crop image by selecting some area of it by dragging it over image.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

三寸金莲 2024-11-25 20:43:03

我希望这有帮助,它是一个 jquery 插件 http://deepliquid.com/projects/ Jcrop/demos.php?demo=handler 帮助您获取裁剪区域的坐标。当你得到这些坐标时,你可以使用
C# 中的以下函数。

   Rectangle CropArea; // assign the rectangle the x,y cordinates.   
   Bitmap bmpImage = new Bitmap(img);
   Bitmap bmpCrop = bmpImage.Clone(cropArea,
   bmpImage.PixelFormat);
   return (Image)(bmpCrop); 

I hope this helps, its a jquery plugin http://deepliquid.com/projects/Jcrop/demos.php?demo=handler which help u get the coordinates for the crop region. when you get those coordinates you can use the
following function in c#.

   Rectangle CropArea; // assign the rectangle the x,y cordinates.   
   Bitmap bmpImage = new Bitmap(img);
   Bitmap bmpCrop = bmpImage.Clone(cropArea,
   bmpImage.PixelFormat);
   return (Image)(bmpCrop); 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文