One of our tools we use to test OneNote inserts images onto a page via our extensibility model. It takes the image date in base64 format and adds it to a page. This is very similar to my image importer tool and the logic I used behind that tool helped me out this week. Here's what happened:
Most of the images we use to test are based on size (large images, huge images, or by pixel size, etc…) and I got a request for a PNG file of one of the images. Now, our images are not stored in image format - they are just XML, like this:
<snip - you get the idea>kZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGR
So I had the task of taking this date and converting it back into an image format.
I thought about adapting my addin for this, or just firing up the tool and interrupting the run to capture the image. Then I remembered ONOMSpy and realized I could very quickly create the image in OneNote using that tool.
I created a page with just the letter 'a' on it first.
Then I started the spy tool and went to that page. I saw the outline element that contained the 'a' and replaced the OE element with the data I wanted:
Then pressed Update Content.
At that point the 'a' on the page was replaced with the XML representation of the image, and the image was shown on the page. I copied that image and sent it to the person that needed it.
All in all, this only took me about a minute, so that saved me a lot of time with the other techniques I could have used. If you are interested in playing around with this, I'm including the image file I used from above. It's a 50x50 blue square, and very boring, but small. If you play around with this, you can see the text representation of the image can get very large very quickly. Remember you need to check the box to Export Binary Data to see the text.
Beware an XML import error!
Questions, comments, concerns and criticisms always welcome,