Slightly daft, but…
Is there a way to prevent Visual Studio treating a .jpg file in a .resx as a Bitmap so that I can access a byte[] property for the resource instead?
I just want:
byte[] myImage = My.Resources.MyImage;
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Try using an “Embedded Resource” instead
So lets say you have a jpg “Foo.jpg” in ClassLibrary1. Set the “Build Action” to “Embedded Resource”.
Then use this code to get the bytes
Or, alternatively, if you want a more re-usable method
and call