Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Is there any IconBitmapEncoder in WPF?

$
0
0

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



Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>