我正在尝试使用WebImage调整图像大小,但我需要所有方面都相等,例如:width: 200 and height: 200
,但保存后图像不会保持比例,例如对200x65
的更改。我怎么能这样做?
尝试。
public class SaveImage{
public static void save(HttpPostedFileBase image, String pathFile, String imgName){
String extension = Path.GetExtension(image.FileName);
String pathToSave = HttpContext.Current.Server.MapPath(pathFile);
WebImage wi = new WebImage(image.InputStream);
wi.Resize(width:200, height:200, preserveAspectRatio:true, preventEnlarge:true);
String imgToSave = Path.Combine(pathToSave, imgName + extension);
wi.Save(imgToSave);
}
}
答案 0 :(得分:0)
解决了这个问题,我做了:sap.ui.getCore().getModel("myModel").update("/ZSystemNameSet(mandt='001')", data, null, function(datay, responsey){
sap.ui.getCore().getModel().refresh();
MessageToast.show("It worked...!! Data: "+datay+"Response: "+responsey);
}, function(datax,responsex){
MessageToast.show("Sorry! Data: "+datax+"Response: "+responsex);
});
并且它运行正常。