Embed image into exe - wpf

I see that Blend 4 is not embedding the image to the EXE as WPF does. WPF will create "/my_project;component/Images" and the image will refer to its component. While inserting image in Blend, it will create "pack://siteoforigin:,,," . Only file with size 250KB above will save the image to EXE. How to do this to every image?
Motive: When I go to production, I need to copy the debug folder. But the image is not placed in the running directory, instead in the solution. So running the debug only will result in a system crash as it cannot found the image.
Question: How to make Blend save every image to the EXE or by mean, the application component?

Related

Load content from a dynamically loaded module with MEF

I'm working on a modular Silverlight application and in one of the modules I'd like to display an image on a view. I've added the image file under the module project in the /Resources/Images directory. And than I've changed the image file's Build Action property to Content. I think it's nicer not to embed the image into the dll file. The xap file after build contains the image.
In the View xaml I've inserted the image <Image Source="/Resources/Images/Yoda.jpg" /> and design time it displays correctly but runtime the image is missing.
My question is how to solve this problem? I don't want to embed in the dll (Build Action: Resource).
I've made a small test solution if you want to play with it:
Solution.zip
Thanks in advance
Design time the image displayed correctly:
But runtime the image is missing:
Solution structure:
You could set the Copy to Output Directory property of the image to either:
Copy always, or
Copy if newer
Then at runtime it will be available.

Way to use WPF Image without attaching image at runtime

I know how to attach an image to a XAML <Image> via VB.net runtime code. How would I do this the normal old way. (Attach the image within the IDE without using any code)
Before WPF one would browse for the image (in the Visual Studio IDE) it would somehow place it in the project and it would work.
Now I do this same thing, I can see the image in my Visual Studio IDE but during runtime the image appears blank.
How would I use the VS IDE to correctly browse for the image so it will display at runtime? Perhaps im doing something wrong a bit of help or any guidance would be awesome
I suppose you have a folder in your project which contains your image files, in that case something similar to <Image Source="/WpfApplication1/component;ImagesFolder/ImageName.png" /> would do the trick.
If you're looking for a non-code way, when you click on tag, you can browse for imported files from Source Property from Properties panel

Silverlight control view image with zoom in/out?

I wanna use an image viewer control in silverlight with feature zoom in/out the image, I found "MultiScaleImage" control that accept source as Xml file, which is can be created by "Deep Zoom Composer" program (install this program: import the images then expose and export: the program will generate the images and the "dzc_output.xml" file for you).
My Question is: I have a images(paths) that comes from the Database, how can I create the xml file at runtime without using the "Deep Zoom Composer" program!!!, I think this is impossible :(
Sooooooo anybody knows a silverlight control that I can use to view image with zoom in/out?????????
In the Deep Zoom Composer program files directory, you will find DeepZoomTools.dll
Use that to generate your images and XML,

How can I access windows file preview icons from my WPF application

I got a bunch of Pictures and Videos in a directory and needs to be displayed in the WPF application, I am thinking about displaying the Win7 Large Icon itself as the preview image. Because that will save me the work of grabbing an appropriate frame from the video file since Windows is doing that job pretty well already.
Any code snippet to access this Shell Icon image data?
When using the Windows API Code Pack, you can do:
XAML
<Image x:Name="img" />
C#
img.Source = ShellFile.FromFilePath(#"C:\path\to\file.ext").Thumbnail.BitmapSource;
This requires adding the Microsoft-WindowsAPICodePack-Shell package and the appropriate namespaces.

Using Visual Studio Image Library PNGs in a Windows Form app

My question is about the Visual Studio Image Library that comes with VS2008. In the _Common Elements\Annotations folder, there are PNGs with multiple sizes and I was wondering what the intended use of these is. Is there an standard way to implement these images, e.g. in a Windows Forms status bar?
Here are three of the PNGs as an example:
The suggested usage is to basically copy/paste the sized image you want into a new image file. Then simply use that as an icon or image in your controls as you see fit. All of the PNGs already have a transparent background, so it should be really easy to copy/paste.

Resources