Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Consider using <a href="http://msdn.microsoft.com/en-us/library/7k989cfy(VS.80).aspx" rel="noreferrer"><code>Properties.Resources.yourImage</code></a></p> <p><a href="http://msdn.microsoft.com/en-us/library/7k989cfy(VS.80).aspx" rel="noreferrer"><code>Properties.Resources</code></a> contains everything that you've added as a resource (see your project properties, resources tab) </p> <p>Other than that, if you embed the images as resource in your project, you can get at them by calling <a href="http://msdn.microsoft.com/en-us/library/system.reflection.assembly.getmanifestresourcestream.aspx" rel="noreferrer"><code>GetManifestResourceStream</code></a> on the assembly that you've embedded the images in, something like</p> <pre><code>Stream imgStream = Assembly.GetExecutingAssembly().GetManifestResourceStream( "YourNamespace.resources.ImageName.bmp"); pictureBox.Image = new Bitmap(imgStream); </code></pre> <p>Don't forget to mark the image as an embedded resource! (You'll need to set the build action for the image in its properties window) </p> <p>If you're finding that you keep getting back <code>null</code> from <a href="http://msdn.microsoft.com/en-us/library/system.reflection.assembly.getmanifestresourcestream.aspx" rel="noreferrer"><code>GetManifestResourceStream</code></a>, you may be giving the wrong name. (It can be hard to get the names right) Call <a href="http://msdn.microsoft.com/en-us/library/system.reflection.assembly.getmanifestresourcenames.aspx" rel="noreferrer"><code>GetManifestResourceNames</code></a> on the assembly; that will give you back all the resource names, and you can find the one in the list that you need.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload