本文实例讲述了JS实现按比例缩放图片的方法。分享给大家供大家参考,具体如下:
js版本:
function resizeImage(obj, MaxW, MaxH)
{
var imageObject = obj;
var state = imageObject.readyState;
if(state!='complete')
{
setTimeout("resizeImage("+imageObject+","+MaxW+","+MaxH+")",50);
return;
本文实例为大家分享了C#图片按比例缩放的具体代码,供大家参考,具体内容如下
工具类代码:
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
na