private void buttonRemap_Click(object sender, EventArgs e) { var destBitmap = new Bitmap(96, 64); var c = new AreaMapCollection(); c.Load(); var imgName = @"FirstCat.png"; // var imgName = @"SourceMap.png"; var gifImg = GetImage(imgName); using (var g = Graphics.FromImage(destBitmap)) { c.Process(gifImg, g); } destBitmap.Save("out.png"); pictureBox1.Image = destBitmap; }
private void cmdRemap_Click(object sender, EventArgs e) { Properties.Settings.Default.SourceFolder = txtSourceFolder.Text; Properties.Settings.Default.DestFolder = txtDestinationFolder.Text; Properties.Settings.Default.Save(); var d = new DirectoryInfo(txtDestinationFolder.Text); if (!d.Exists) { d.Create(); } var c = new AreaMapCollection(); c.Load(); var files = GetFiles("*.png"); foreach (var file in files) { var destBitmap = new Bitmap(96, 64); var gifImg = GetImage(file.FullName); var outName = Path.Combine( txtDestinationFolder.Text, file.Name ); using (var g = Graphics.FromImage(destBitmap)) { c.Process(gifImg, g); } if (rbImage.Checked) { destBitmap.RotateFlip(RotateFlipType.Rotate90FlipNone); } else if (rbVideo.Checked) { destBitmap.RotateFlip(RotateFlipType.Rotate270FlipNone); } destBitmap.Save(outName); } MessageBox.Show("Done"); }
private void cmdRemap_Click(object sender, EventArgs e) { Properties.Settings.Default.SourceFolder = txtSourceFolder.Text; Properties.Settings.Default.DestFolder = txtDestinationFolder.Text; Properties.Settings.Default.Save(); var d = new DirectoryInfo(txtDestinationFolder.Text); if (!d.Exists) d.Create(); var c = new AreaMapCollection(); c.Load(); var files = GetFiles("*.png"); foreach (var file in files) { var destBitmap = new Bitmap(96, 64); var gifImg = GetImage(file.FullName); var outName = Path.Combine( txtDestinationFolder.Text, file.Name ); using (var g = Graphics.FromImage(destBitmap)) { c.Process(gifImg, g); } if (rbImage.Checked) destBitmap.RotateFlip(RotateFlipType.Rotate90FlipNone); else if (rbVideo.Checked) destBitmap.RotateFlip(RotateFlipType.Rotate270FlipNone); destBitmap.Save(outName); } MessageBox.Show("Done"); }