protected void btnCreate_Click(object sender, EventArgs e) { Thread thread = new Thread(() => WebPageBitmap.InitBitmap("wtest3", ShareMode.Question, "")); thread.SetApartmentState(ApartmentState.STA); thread.Start(); thread.Join(); }
public static void LoadBitmapSTA(String word, String path) { Thread thread = new Thread(() => WebPageBitmap.InitBitmap(word, ShareMode.Question, path)); // make sure bitmap exists thread.SetApartmentState(ApartmentState.STA); thread.Start(); thread.Join(); }