DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Microsoft Information Leaker 'Exiting the Game', But Not Without Spilling More Beans
  • HowTo: Store and Retrieve Images in a SQL CE Database on Windows Phone Mango
  • Using the TabControl on Windows Phone 7
  • Using the LongListSelector control on Windows Phone 7

Trending

  • Part 2: Securing and Scaling Goose-to-Java Agent Traffic With agentgateway
  • Rebuilding Elasticsearch Under Load: Unsafe Watermarks and a Sampling Blind Spot
  • Batching Strategies: Throughput vs Latency in Practice
  • Data Integration Landscape 2026: Event Streaming, API, and Batch in the Era of Agentic AI

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

How to Load Image that is set as Embedded Resource in BuildAction in Windows Phone

By 
Senthil Kumar
·
Nov. 07, 11 · News
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
11.9K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

In one of my previous posts, I explained how to load the Image that is Set as Resource in Build Action .

In this blog post, I will provide you a sample that loads the image which is set as “Embedded Resource” in Windows Phone using the Assembly’s GetManifestResourceStream.

Use the GetManifestResourceStream method in the Assembly object by passing the image name.

Make sure that the image is set to the Embedded Resource and when passing the image name pass the image name along with the Namespace as shown in the below sample code where PhoneApp3 is the ProjectName and StartScreen.jpg is the file name.

Set the BitMapImage’s source to the stream and assign this to the Source property of the Image.

private void button1_Click_1(object sender, RoutedEventArgs e)
{
Assembly CurrentAssembly;
CurrentAssembly = Assembly.GetExecutingAssembly();
Stream EmbeddedResourceStream = CurrentAssembly.GetManifestResourceStream(“PhoneApp3.StartScreen.jpg”);
BitmapImage bitMapImage = new BitmapImage();
bitMapImage.SetSource(EmbeddedResourceStream);
image1.Source = bitMapImage;
}

 

Windows Phone

Published at DZone with permission of Senthil Kumar. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Microsoft Information Leaker 'Exiting the Game', But Not Without Spilling More Beans
  • HowTo: Store and Retrieve Images in a SQL CE Database on Windows Phone Mango
  • Using the TabControl on Windows Phone 7
  • Using the LongListSelector control on Windows Phone 7

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook