カルチャの変更
Thread.CurrentThread.CurrentCulture = new CultureInfo("en");
Thread.CurrentThread.CurrentUICulture = new CultureInfo("en");
Assemblyの取得
var assembly = System.Reflection.Assembly.Load("TargetApp");
#型の列挙
assembly.GetTypes()
#FormとUserControl以外はじく
if(!(type.IsSubclassOf(typeof(Form)) || type.IsSubclassOf(typeof(UserControl)))) continue;
#インスタンス化
var instance = Activator.CreateInstance(type);
#コントール列挙
foreach (FieldInfo memberInfo in ti.DeclaredFields)
{
var declareField = memberInfo.GetValue(instance);
}
#Formキャプチャ
Bitmap bmp = new Bitmap(form.Width,form.Height);
form.DrawToBitmap(bmp, new Rectangle(0, 0 ,form.Width, form.Height));
bmp.Save(type.FullName + ".bmp");
#UserControlをFormに追加してキャプチャ
var userControlForm = new Form();
userControlForm.ControlBox = false;
userControlForm.Controls.Add((UserControl)instance);
userControlForm.Show();
Bitmap bmpUserControl = new Bitmap(userControlForm.Width, userControlForm.Height);
userControlForm.DrawToBitmap(bmpUserControl, new Rectangle(0, 0, userControlForm.Width, userControlForm.Height));
bmpUserControl.Save(type.FullName + ".bmp");
userControlForm.Close();