|
-
Feb 22nd, 2007, 05:57 PM
#1
[RESOLVED] [2005] Getting image from embedded resource
I currently grab an image from an embedded resource using
VB Code:
Dim WImage As Image = New Bitmap(Me.GetType(), "myimage.png")
but the result is poor compared to the original png. The conversion to a bitmap seems to dramatically lower the quality since any white space in the image gets filled with a different color. I tried improving the PixelFormat, but it does not have much effect. Is there a way I can get the image directly, rather than having to go through a bitmap?
-
Feb 22nd, 2007, 07:08 PM
#2
Re: [2005] Getting image from embedded resource
Actually, the problem is not the bitmap quality, it is the appearance of the image when used as a ListView item image. If I put the image into a picturebox, it looks perfect, use it in a listview, looks horrible.
The left image is a picture box, the right is when the same image is used in a ListView. What am I missing here?
-
Feb 22nd, 2007, 07:12 PM
#3
Re: [2005] Getting image from embedded resource
That's the ImageList doing that. What is the ColorDepth property of the ImageList set to?
-
Feb 22nd, 2007, 07:20 PM
#4
Re: [2005] Getting image from embedded resource
It's "Depth8bit", so I guess it should be something better. Can I use any value?, or should I stick to something that will display properly on all computers?
32Bit looks perfect.
-
Feb 22nd, 2007, 08:05 PM
#5
Re: [RESOLVED] [2005] Getting image from embedded resource
You should use the highest value that doesn't require you to downsample any of the contained images. If the highest resolution of any of the images is 24 bit then use 24 bit. If in doubt play it safe and use the highest.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|