Main Site Documentation

VB - Display a bitmap on T35 display from Resources


#1

I have added a small bitmap (30 pixels x 30 pixels) to the project resources folder and wish to load it onto the T35 display. I have guessed at setting properties for the bitmap as “Build Action: Embedded Resource” and “Copy to Output: Copy Always”.

My VB code looks like this so far and doesn’t work.

Dim picture As Bitmap
        picture = New Image("BlueSlider.bmp")
        Display.SimpleGraphics.DisplayImage(picture, 0, 0)

Any help much appreciated.The only information I have relates to loading images from an SD card. I would rather not do so for this project.
Mainboard used is a Fez Spider.


#2

Thanks Andre but VB not happy with that. I have tried several variants but doesnt like “properies” or “BinaryResources”


#3

Try:

Resources.GetBitmap(Resources.BitmapResources.Image1)

Use the correct id in place of Image1


#4

Tried

 picture = New Image(Resources.GetBitmap(Resources.BitmapResources.BlueSlider.bmp))

but returns error:

‘BitmapResources’ is not a member of 'Resources

and

‘GetBitmap’ is not a member of ‘Resources’


#5

You need to add bitmap file using the resource manager.
As soon as you do that VS will generate all missing code.


#6

The name should match your recource name, not the filename, see screenshot attched.


#7

Hi, you might be hitting this problem:

It’s a namespace issue around resources.

Jas


#8

And 1 line extra :


#9

it’s not enough only add the bitmap to the folder.
you have to doubleclick the “Resources.resx” in the project-explorer and then using the “add” function to register the resource