C
Cocotteseb
Hello!
In my project, I have different pictures for QVGA and VGA. Making them
as embedded ressources makes the .exe file too big. Moreover a QVGA
user does not need to load VGA pictures and vice versa.
So I would like to create two separate dll, name them QVGA.dll and
VGA.dll
It presents like this in VS
Solution App
-VGA (a class library)
-QVGA (a class library)
-App (the application)
In the two classes i place the corresponding images as ressources.
(using my my project> properties> ressources)
Let's say Image1.png
Now in App project I reference the two dll and I want to load an image
in picturebox. But I do not know how.
When it is an embedded ressources i should do PictureBox21.Image = New
Bitmap(Reflection.Assembly.GetExecutingAssembly.GetManifestResourceStream("App.Image1.png"))
But in this situation I try : Dim rm2 As New ResourceManager("VGA",
Assembly.GetExecutingAssembly())
PictureBox21.Image = New Bitmap(rm2.GetObject("Image1.png")). But it
fails and seems to be really wrong.
Help!
Btw: theorically is my solution bad ? Is there a better one?
Thank you a lot for your help!
In my project, I have different pictures for QVGA and VGA. Making them
as embedded ressources makes the .exe file too big. Moreover a QVGA
user does not need to load VGA pictures and vice versa.
So I would like to create two separate dll, name them QVGA.dll and
VGA.dll
It presents like this in VS
Solution App
-VGA (a class library)
-QVGA (a class library)
-App (the application)
In the two classes i place the corresponding images as ressources.
(using my my project> properties> ressources)
Let's say Image1.png
Now in App project I reference the two dll and I want to load an image
in picturebox. But I do not know how.
When it is an embedded ressources i should do PictureBox21.Image = New
Bitmap(Reflection.Assembly.GetExecutingAssembly.GetManifestResourceStream("App.Image1.png"))
But in this situation I try : Dim rm2 As New ResourceManager("VGA",
Assembly.GetExecutingAssembly())
PictureBox21.Image = New Bitmap(rm2.GetObject("Image1.png")). But it
fails and seems to be really wrong.
Help!
Btw: theorically is my solution bad ? Is there a better one?
Thank you a lot for your help!