简体   繁体   中英

Codedom add resource

I'm compiling some source (it's a wpf window) with codedom. Now I want to add some resources (images) without dropping the file first. Is that possible?

If yes, how? And how can i access the images within the new application?

On request some more detailed informations:

User can enter / select some data. After that, the user can click compile which creates a custom application (wpf).

Now I want to add some image resources at compiling, so that I can create a nicer GUI for the dynamic created application.

Okay, i managed the problem finaly.

I converted the image to an byte array, then wrote a new Resource (with ResourceWriter) and finally (CompilerParameters)EmbeddedResources.Add.

In the created WPF Window I grab the array, convert it back to an BitmapImage and assign it to an image control.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM