I am creating images in various formats in WPF using BitmapEncoder. For example, to create a png image from a FrameworkElement, i am using the following code,
BitmapEncoder imgEncoder = new PngBitmapEncoder(); RenderTargetBitmap renderBitmap = new RenderTargetBitmap(32, 32, 96d, 96d, PixelFormats.Pbgra32); renderBitmap.Render(controlToConvert); imgEncoder.Frames.Add(BitmapFrame.Create(renderBitmap));
I like to create an .ico file in the same way. But I cannot find any IconBitmapEncoder in WPF. Is there any other way to do it?
Regards,
Jawahar