Is there a bug with PNG files in Resources in Net 3
-
If I use an ImageList as my source for a PictureBox I can use JPG and PNG files. If I load the images into Resources, I can still use the JPG files, but the PNG images are not visible. Unfortunately, I need PNG format for the transparency.
-
If I use an ImageList as my source for a PictureBox I can use JPG and PNG files. If I load the images into Resources, I can still use the JPG files, but the PNG images are not visible. Unfortunately, I need PNG format for the transparency.
I regularly use PNG files as resources, with no problems whatever. Admittedly I rarely use
PictureBox
, as I find it an unsatisfactory control on many fronts. However, on those occasions that I have used it I have had no problems so long as the image type is one supported by the .Net Framework.Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
-
I regularly use PNG files as resources, with no problems whatever. Admittedly I rarely use
PictureBox
, as I find it an unsatisfactory control on many fronts. However, on those occasions that I have used it I have had no problems so long as the image type is one supported by the .Net Framework.Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
Thanks. Experimenting converting the same image to JPG (so I lose my transparency) I can see my problem. From an ImageList it was made to fit the PictureBox size. From Resources it is not, and what was visible on screen was a tiny, transparent!!, corner of the image. I will have to experiment with formatting the image to be the correct size.
-
Thanks. Experimenting converting the same image to JPG (so I lose my transparency) I can see my problem. From an ImageList it was made to fit the PictureBox size. From Resources it is not, and what was visible on screen was a tiny, transparent!!, corner of the image. I will have to experiment with formatting the image to be the correct size.
The
PictureBox
has aSizeMode
property. Set it toStretchImage
to ensure that the image fills thePictureBox
. Have a play with the other settings, to get familiar with how it works.Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
-
The
PictureBox
has aSizeMode
property. Set it toStretchImage
to ensure that the image fills thePictureBox
. Have a play with the other settings, to get familiar with how it works.Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
Or throw it out of the window, and paint stuff yourself, then you know all the time what is going on. :)
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
-
Or throw it out of the window, and paint stuff yourself, then you know all the time what is going on. :)
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
Absotively!! That's what I do. I really cannot remember the last time I used a PictureBox. But then I can't remember the last time I watered the plants or mowed the cat eithter. :)
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
-
Absotively!! That's what I do. I really cannot remember the last time I used a PictureBox. But then I can't remember the last time I watered the plants or mowed the cat eithter. :)
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
Henry Minute wrote:
I can't remember the last time I watered the plants or mowed the cat eithter.
Don't worry, once mowed properly a cat doesn't need seconds. :)
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
-
Henry Minute wrote:
I can't remember the last time I watered the plants or mowed the cat eithter.
Don't worry, once mowed properly a cat doesn't need seconds. :)
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
-
If I use an ImageList as my source for a PictureBox I can use JPG and PNG files. If I load the images into Resources, I can still use the JPG files, but the PNG images are not visible. Unfortunately, I need PNG format for the transparency.
Yeah I'm not too sure about that one. I always use PNG as I have found that it has the highest quality and smallest file size. But I have noticed a few problems when using PNG's with the PictureBox, I'm not sure what causes these problems, but all I know is that when I select "Auto-size" I don't have any problems with the PictureBox.
-
Yeah I'm not too sure about that one. I always use PNG as I have found that it has the highest quality and smallest file size. But I have noticed a few problems when using PNG's with the PictureBox, I'm not sure what causes these problems, but all I know is that when I select "Auto-size" I don't have any problems with the PictureBox.
It turns out the problem was with SizeMode. Using an ImageList seems to automatically use Zoom. Taking the image from Resources doesn't, and all I could see was the top left (transparent) corner of my image!!