Is there any way I could get a jpg images in a dll file?
I'm not new to C#, but I only know the basic things and wondering if this is possible and how.
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Bechir BejaouiRank #144 · 15.9K reputationPosted Mar 9, 2009, 9:01 AM EDT
first step:
add your image or any type of ressource like text file and other none applicative(dll,exe) objects to a resx file, this article will help you to perform that
http://www.c-sharpcorner.com/UploadFile/yougerthen/105262008135822PM/1.aspx
second step:
Complie this resx file to dll
start>All programs>Micrsoft visual studio>Microsoft visual studio tools> Command prompt
then execute the command
csc /out: myAssembly.dll /target:library /res:
Michael12 reputationPosted Mar 9, 2009, 10:35 AM EDT
Also, how can I add the picture directly to a picturebox? I can't get that working.
And, can I put any files in a resx/dll file? I would like also to put a mp3 and wma file in it, but it returns a error, like also stated on that article.
I currently have:
Assembly h = Assembly.LoadFile(System.Environment.CurrentDirectory +"\\PHD.dll");
Stream s = h.GetManifestResourceStream("test.rsx");
But how do I get the image now?
Bechir BejaouiRank #144 · 15.9K reputationPosted Mar 14, 2009, 12:01 PM EDT
Michael12 reputationPosted Mar 14, 2009, 2:08 PM EDT
And got the loading part already working.
Bechir BejaouiRank #144 · 15.9K reputationPosted Mar 17, 2009, 7:51 AM EDT
http://support.microsoft.com/kb/309158
same thing could be said concerning avi files