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
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

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

  • How to Perform Custom Error Handling With ANTLR
  • Secure by Design: Modernizing Authentication With Centralized Access and Adaptive Signals
  • Operational Principles, Architecture, Benefits, and Limitations of Artificial Intelligence Large Language Models
  • Mastering Fluent Bit: Installing and Configuring Fluent Bit on Kubernetes (Part 3)

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

By 
Senthil Kumar user avatar
Senthil Kumar
·
Nov. 07, 11 · News
Likes (0)
Comment
Save
Tweet
Share
11.6K Views

Join the DZone community and get the full member experience.

Join For Free

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, DZone MVB. 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

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

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 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: