Link to home
Start Free TrialLog in
Avatar of bramsquad
bramsquadFlag for United States of America

asked on

easy include bitmap question

i have an included bitmap in my solution explorer, where do i find it if i want to show it in my project?

thanks,

~b
ASKER CERTIFIED SOLUTION
Avatar of Ignacio Soler Garcia
Ignacio Soler Garcia
Flag of Spain image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bramsquad

ASKER

im not quite sure i understand your code, plus its giving me an error.  please explain.

this is my code...

    Public Function CreateImage(ByVal vName As String) As Bitmap
        Dim executingAssembly As System.Reflection.Assembly = Me.GetType.Assembly.GetAssembly(Me.GetType)
        Dim myNamespace As String = executingAssembly.GetName().Name.ToString()

        Return New Bitmap(Me.GetType.Assembly.GetAssembly(Me.GetType).GetManifestResourceStream(vName)) '<--ERROR HERE
    End Function

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Me.PictureBox11.Image = CreateImage("optical_illusion_1.jpg")
    End Sub

and this is the error message that im getting...

Additional information: 'null' is not a valid value for 'stream'.

thanks for your help

`~b

Check this:

a) Have you setted the property of the image Generation Action to "Embedded resource"?
b) Have you passed the full name of the image (including capitalization). For example, a image called pPp.bmp into a folder called FOLDER inside a Project called CycleLog must be called "CycleLog.FOLDER.pPp.bmp?

Askme more if you need it

SoMoS
 
thanks!