/// <summary> /// 主要作業方法 /// </summary> public Image Operation() { System.Drawing.Image img = GenData(string.Format("https://graph.facebook.com/{0}/picture?type=large", this._FBUID)); if (img.Width > img.Height) { int width = (int)(img.Width * this._size / img.Height); DrawStaticResize DS = new DrawStaticResize(img, width, this._size); img = DS.Operation(); DrawCrop DC = new DrawCrop(img, (int)((width - this._size) / 2), 0, _size, _size); img = DC.Operation(); } else { int height = (int)(img.Height * this._size / img.Width); DrawStaticResize DS = new DrawStaticResize(img, this._size, (int)(img.Height * this._size / img.Width)); img = DS.Operation(); DrawCrop DC = new DrawCrop(img, 0, (int)((height - this._size) / 2), this._size, this._size); img = DC.Operation(); } image = img; return(image); }
/// <summary> /// 主要作業方法 /// </summary> public Image Operation() { System.Drawing.Image img = GenData(string.Format("https://graph.facebook.com/{0}/picture?width={1}&height={1}", this._FBUID, this._size)); if (img.Width > img.Height) { int width = (int)(img.Width * this._size / img.Height); DrawStaticResize DS = new DrawStaticResize(img, width, this._size); img = DS.Operation(); DrawCrop DC = new DrawCrop(img, (int)((width - this._size) / 2), 0, _size, _size); img = DC.Operation(); } else { int height = (int)(img.Height * this._size / img.Width); DrawStaticResize DS = new DrawStaticResize(img, this._size, (int)(img.Height * this._size / img.Width)); img = DS.Operation(); DrawCrop DC = new DrawCrop(img, 0, (int)((height - this._size) / 2), this._size, this._size); img = DC.Operation(); } image = img; return image; }