How to rotate image and save the image

前端 未结 5 1976
予麋鹿
予麋鹿 2020-12-03 02:03

In my application i have an image in a div,a button.

I want to rotate the image displayed and save the rotated image when i clicked on the button using jquery.

5条回答
  •  春和景丽
    2020-12-03 02:21

    it will helps to rotate an image and save the image in whatever the angle image has. for example we rotated image into 180 degrees .we can save that image (180 degrees) into our folder.here we used canvas.it helps for ASP.NET developers

    
    
    
    protected void OKFinalSave_Click(object sender, EventArgs e)
    {
    
        string
        CropImageLocation = ConfigurationManager.AppSettings["CropFileLocation"].ToString();
        CropImageLocation = CropImageLocation + DateTime.Now.ToString("yyyyMMdd") + "\\" + LoanNumber.Value;
        string
        a = CropImageLocation + "\\" + LoanNumber.Value + "_SIGN";
        string
        base64String = hfData.Value.Replace("data:image/png;base64,", string.Empty);
        byte[]
        bytes = Convert.FromBase64String(base64String);
        string
        filePath = a;
    
        if (!Directory.Exists(CropImageLocation)) {
            Directory.CreateDirectory(CropImageLocation);
        }
        if (File.Exists(a)) {
            File.Delete(CropImageLocation + "\\" + LoanNumber.Value + "_SIGN");
    
        }
    
        System.IO.File.WriteAllBytes(CropImageLocation + "\\" + LoanNumber.Value + "_SIGN.jpeg", bytes);
        SaveCropedPath(LoanNumber.Value, CropImageLocation + "\\" + LoanNumber.Value + "_SIGN.jpeg");
    }
    
    
    
    

提交回复
热议问题