private void ofdRIXVGA_FileOk(object sender, CancelEventArgs e) { RIXFile splashTexture = new RIXFile(ofdRIXVGA.FileName); toolStripStatusLabel1.Text = "ColorRIX VGA File Loaded."; if (splashTexture != null) { pictureBox1.Image = splashTexture.toBitmap(); } }
private void ofdIMPORT_FileOk(object sender, CancelEventArgs e) { Bitmap ic = (Bitmap)Image.FromFile(ofdIMPORT.FileName); Bitmap bm = new Bitmap(ic.Width, ic.Height); Graphics g = Graphics.FromImage(bm); g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.Half; g.DrawImage(ic, new RectangleF(0f, 0f, ic.Width, ic.Height), new RectangleF(0f, 0f, ic.Width, ic.Height), GraphicsUnit.Pixel); RIXFile rixNew = new RIXFile(bm, commonColors); pictureBox1.Image = rixNew.toBitmap(); }