开发者

resizing my image using GetThumbImage method C#

开发者 https://www.devze.com 2023-02-27 10:15 出处:网络
I successfully manage to upload an image to my websitemy website and added it to a database(the name of the image) and then returned a dataset using a webmethod to display the image in a gridview.

I successfully manage to upload an image to my website my website and added it to a database(the name of the image) and then returned a dataset using a webmethod to display the image in a gridview. The only problem I have now(still) is to size the picture and I think it might be appropriate to use the GetThumbNailImage method.

I am however struggeling a bit.

This is my code for thw uploading of the image and I would like to know how to use this method as 开发者_如何学Cpart of this code to size the image appropriately.

if (FileUpload1.HasFile)
    {
        try
        {
            string filename = Path.GetFileName(FileUpload1.FileName);

            FileUpload1.SaveAs(Server.MapPath("~/") + filename);
            StatusLabel.Text = "Upload status: File uploaded!";
        }
        catch (Exception ex)
        {
            StatusLabel.Text = "Upload status: The file could not be uploaded. The following error occured: " + ex.Message;
        }
    }

KInd regards Arian

0

精彩评论

暂无评论...
验证码 换一张
取 消