c# - Add Image to Base64 Encoded ImageStream in Resources (resx) -
I am working on an old project, updating it. There is a toolstrip with a button in some part of the program, with each single image. I've found that the images are stored in a Base64 encoded ImageStream in resx for the form and can be accessed in such a way as:
System.ComponentModel.ComponentResourceManager resources = New System. ComponentModel.ComponentResourceManager (typeof (Form1)); ... this.imageList1 = new system.window.form. Image list (this.components); ... this.toolStrip1.ImageList = this.imageList1; ... this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer) (resources.GetObject ("imageList1.ImageStream"))); ... this.toolStripButton1.ImageIndex = 0; // There are 41 images in it, so it can be between 0 and 40
I have to add another button with a new image. How can I add an image to this stream?
I can not use the designer, because as soon as I load the form, as soon as the crash (I believe it uses a custom component with the unsafe code).
I can always just separate a new image from the processing stream, but it is that a button will be different and thus it creates problems with continuity, due to later maintenance problems. So I'm thinking that to edit the imagestream for me in any way I can use the raw base64 string but I do not know where to go from here.
Comments
Post a Comment