public MainForm() { InitializeComponent(); Bitmap bitmap; using (var stream = typeof(MainForm).Assembly.GetManifestResourceStream("FormApplication.character.png")) { bitmap = (Bitmap)Bitmap.FromStream(stream); } unsafe { m_BitmapPtr = (IntPtr)BitmapUtility.GetBitmapPtrFromHICON((void *)bitmap.GetHicon()); } }