Using C# or VB.NET, and under Windows Forms, which for this I'm using WPF library classes to make it easier, I would like to load a .ico file, then I will add a new frame to the icon object, and save the icon object with the new frames added (preferably as a System.Drawing.Icon
object, otherwise, save it as a new .ico file), simple as that.
For iterating the frames of an icon I'm using the IconBitmapDecoder
class, I'm following this example. However, the IconBitmapDecoder.Frames
is a ReadOnlycollection
, so I'm stuck at this point, I don't know which class I need to use to create an icon, adding the frames that I obtained using the IconBitmapDecoder
class, plus the additional frames that I want to add.
If necessary, bitmap frames (a System.Windows.Media.Imaging.BitmapFrame
or BitmapSource
object) can be converted to a System.Drawing.Bitmap
object by following this example.
Please note that I'm very inexperienced using WPF classes.