七行プログラミング part6at TECH
七行プログラミング part6 - 暇つぶし2ch188:デフォルトの名無しさん
08/12/16 20:43:48 .net
>>187
合わせ鏡みたいな何かです。

文字数に余裕があったので回転も加えてみた

using System.Drawing;using System.Drawing.Drawing2D;using f=System.Single;
class P{static void Main(string[]a){using(Bitmap i=new Bitmap(a[0])){M(i,1,f.
Parse(a[1]),f.Parse(a[2]),f.Parse(a[3]),f.Parse(a[4]));i.Save(a[0]+"-d.bmp");}
}static Bitmap M(Bitmap i,f s,f z,f r,f w,f h){if(s>.0001){using(Bitmap t=M((
Bitmap)i.Clone(),s*z,z,r,w,h))using(Graphics g=Graphics.FromImage(i))using(
Matrix m=new Matrix()){m.Translate(w,h);m.Scale(s,s);m.Rotate(r);m.Translate(
-w,-h);g.Transform=m;g.DrawImage(t,new Point());}}return i;}}

usage: filename z(<1.0) r w h

なんか逆に汚くなったような… orz


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch