Page 1 of 1

How to write a multi-resolution ico?

Posted: 2016-02-25T02:55:07-07:00
by error0x6b
I basically want to do this:

Code: Select all

convert.exe input.png -define icon:auto-resize="256,128,64,48,32,16" output.ico
with my MagickImage-Object, but I don't know how. I also thought on creating the different resolutions by myself, but there's still the problem to save all the different resolution versions into the same ico.
Are multi resolution ico files even supported by the wrapper to this date? And if not, is there a workaround like directly accessing the wrapped functionality? Temporary files are not a problem for me.

My backup plan is to install ImageMagick additionally to the wrapper to use convert.exe, but I want to determine if it's possible without doing it

Thank you very much

Re: How to write a multi-resolution ico?

Posted: 2016-02-26T12:53:57-07:00
by dlemstra
Most options are methods of the MagickImage class. The command translates to this:

Code: Select all

using (MagickImage image = new MagickImage("input.png"))
{
  image.SetDefine(MagickFormat.Icon, "auto-resize", "256,128,64,48,32,16");
  image.Write("output.ico");
}