然后,Asp.net Crop 将文件作为发布文件发送到 http 处理程序

发布于 2024-12-28 10:54:58 字数 177 浏览 4 评论 0原文

我正在尝试裁剪图像,然后获取结果图像并保存在服务器上的目录中返回该图像的 url,我需要将其作为发布文件发送到 http 处理程序(与我们从对话框中选择文件之后相同,然后它将转换为发布文件,以便我们可以获得文件名和文件内容)。而且我没有机会编辑http处理程序,我需要将裁剪后的图像URL作为发布文件发送。

请帮帮我。 谢谢

I'm trying to Crop the Image, then take the result image And save in directory on the server return url of this image i need to send as a posted file to http handler(same thing like after we choosing file from dialog box,then it will converted as posted file so that we can get file name and file content).And i dont have a chance to edit http handler i need to send croped imge url as a posted file.

Please help me out.
thanks

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

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

发布评论

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

评论(2

高速公鹿 2025-01-04 10:54:59

您可以使用 Jquery 插件来完成您的任务。因为我没有进行任何类型的裁剪,但我找到了一个可能对您有帮助的链接。尽管您可以在 Jquery 中找到许多用于裁剪的插件。 Jquery 裁剪插件

Jquery - Asp.net 裁剪图像并保存。

you can use Jquery plugins to accomplish your task. as i am not done any kind of cropping, but i found a link which may help you. though you can find many plugins for crop in Jquery. Jquery crop plugins

Jquery - Asp.net Cropping Image and Saving.

夏尔 2025-01-04 10:54:59

这是我用来通过 vb.net 裁剪图像的代码,但首先您应该下载此控件

    <asp:Panel ID="pnl" runat="server" HorizontalAlign="Right" Font-Names="Tahoma" 
    Font-Size="15pt">
    Upload your picture
    <br />
       <asp:Panel ID="croppnl" runat="server" HorizontalAlign="Left" Width="810px">
        <asp:Image ID="Image1" runat="server" />
        <cs:CropImage ID="CropImage1" runat="server" Image="image1" 
            IsInUpdatePanel="False" />
        <asp:Button ID="cropbtn" runat="server" CausesValidation="False" 
            Font-Names="Tahoma" Text="Crop" />
        <br />
    </asp:Panel>

代码隐藏:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  Image1.ImageUrl = "~/Image.jpg"
End Sub


Protected Sub cropbtn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cropbtn.Click
  CropImage1.Crop(MapPath("croppedpictures.jpg"))
End Sub

here is the code I used to crop images through vb.net,but first you should download this control:

    <asp:Panel ID="pnl" runat="server" HorizontalAlign="Right" Font-Names="Tahoma" 
    Font-Size="15pt">
    Upload your picture
    <br />
       <asp:Panel ID="croppnl" runat="server" HorizontalAlign="Left" Width="810px">
        <asp:Image ID="Image1" runat="server" />
        <cs:CropImage ID="CropImage1" runat="server" Image="image1" 
            IsInUpdatePanel="False" />
        <asp:Button ID="cropbtn" runat="server" CausesValidation="False" 
            Font-Names="Tahoma" Text="Crop" />
        <br />
    </asp:Panel>

Codebehind:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  Image1.ImageUrl = "~/Image.jpg"
End Sub


Protected Sub cropbtn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cropbtn.Click
  CropImage1.Crop(MapPath("croppedpictures.jpg"))
End Sub
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文