0

I would like to write a programme to dynamically update the windows task bar icon at runtime by writing some custom text onto the icon. To do so I need to create a blank white BitmapImage, but this seems to be impossible...

All constructors want some URI, or Stream. Any ideas how this can be done?

Thanks alot

Franz Kafka
  • 10,623
  • 20
  • 93
  • 149
  • Does this answer your question? [How to create bitmap from byte array?](https://stackoverflow.com/questions/21555394/how-to-create-bitmap-from-byte-array) – izlin Jan 28 '22 at 13:54
  • @izlin Why would it? [`BitmapImage`](https://learn.microsoft.com/en-us/dotnet/api/system.windows.media.imaging.bitmapimage?view=windowsdesktop-6.0) isn't mentioned anywhere on that question or its answers. – ProgrammingLlama Jan 28 '22 at 13:54
  • Thanks, but this link is about Bitmap, i'm asking about BitmapImage – Franz Kafka Jan 28 '22 at 13:55
  • Create an array, fill it with all `0xff` and then use the solution from the link – izlin Jan 28 '22 at 13:56
  • @FranzKafka My bad, thought Bitmap and BitmapImage were similar but I was wrong. – izlin Jan 28 '22 at 13:58
  • OP: it seems there is a `WriteableBitmap`, and it seems there are methods to convert this to a `BitmapImage`. I'm not sure if that answers your question though, as I've never used any of these (I'm mostly a backend dev) but hopefully the information might be helpful. – ProgrammingLlama Jan 28 '22 at 14:01
  • 1
    Seems like an XY problem, type of icon is `ImageSource`, do you really need a `BitmapImage`? – shingo Jan 28 '22 at 14:29

0 Answers0