Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
469 views
in Technique[技术] by (71.8m points)

.net - How to add PNG resource in Visual Studio 2010?

I have a PNG (i.e. a compressed image) that I'd like to include in my assembly (i.e. application).

How to do it?

Additional information:

I tried adding a PNG resource to my assembly in Visual Studio 2010:

enter image description here

But that didn't work, as Visual Studio converts it to an uncompressed bitmap:

enter image description here

Except I want to add a PNG.

Otherwise my 1MB application becomes 8MB:

]=== 1MB file size ==>
]=== 8MB file size ==============================================================================================================================================>
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
  1. Go to the project menu -> properties.
  2. Select the resources tab
  3. Make sure Images is selected first.
  4. Click the arrow beside 'add resource'
  5. New Image (Select from Image File Types)
  6. Find the PNG

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...