Use this package to easily resize, save or export to byte-array any System.Drawing.Image (or Bitmap). (More are to come, including WPF support for Windows.Media (BitmapImage etc)).
Code Sample:
1. Create a WinForm application
2. Add two PictureBox'es (PictureBox1 and PictureBox2)
3. Load an image into PictureBox1
4. Add 2 command button's (button1 and button2)
Add this code to the class behind the form:
private void button1_Click(object sender, EventArgs e)
{
pictureBox2.Image =
pictureBox1.Image
.Resize(100, 100, true, System.Drawing.Drawing2D.SmoothingMode.HighQuality,
System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic,
System.Drawing.Drawing2D.CompositingQuality.HighQuality,System.Drawing.Imaging.ImageFormat.Png,
100, true);
}
private void button2_Click(object sender, EventArgs e)
{
pictureBox1.Image.SaveAs("d:\\test.ico", 50, System.Drawing.Imaging.ImageFormat.Png);
}
How it looks: