Display images

Hello!

Does anyone know what kind of formats could we display using a fez panda? or maybe, how can we convert jpg to a valid format? I have been trying it but I can´t display any image. I found an example (monkey image) but I don´t know the format of that image because it has not extension and I only know that it has type=application/octet-stream.

There is a built in image support (JPEG, BMP, GIF) but it only works on devices with more memory, like G120 (FEZ Cobra) for example. Some smaller devices support images but only BMP.

@ Gus - and can it be used if I load the images within a sd?

@ Elsa - you can show images but you are not going to use the built in image services. For example, you can convert an image to a byte array that you then send to the display. This array can bein your code, in a resource or on an SD card.

@ Gus - Thanks! Now I understand. I’m begginner with this and I thought that It could be a problem with images format but I think that my problem is not related with that. I get this exception;

An unhandled exception of type ‘System.NotImplementedException’ occurred in mscorlib.dll

In this return:

internal static Microsoft.SPOT.Bitmap GetBitmap(Resources.BitmapResources id)
{
return ((Microsoft.SPOT.Bitmap)(Microsoft.SPOT.ResourceUtility.GetObject(ResourceManager, id)));
}
[System.SerializableAttribute()]
internal enum BitmapResources : short
{
Image1 = 21113,
}

Thanks!

GetBitmap() gives you a Not Implemented error - that code is not in that device’s capabilities (needs too much memory) so GHI have left it out. You can’t use it.

What are you trying to do? What is the general purpose of trying to use GetBitmap?

@ Brett - my purpose is to display an image on the fez touch so I converted the image to bmp and I tried to display it. Do you know if I can convert the image to a different format or anything? The image has 14kb

The strack trace of the response that I get is:

System.Resources.ResourceManager::GetObjectInternal
System.Resources.ResourceManager::GetObjectFromId
Microsoft.SPOT.ResourceUtility::GetObject
FEZTouchDriver_Example.Resources::GetBitmap
FEZTouchDriver_Example.Program::InitGraphics
FEZTouchDriver_Example.Program::Main

I’m not sure about what is happening but I can load and display the monkey image that I found on a example (I don´t know the format of that image because it is an archive that I can´t open with any image program)

You can safely ignore GetBitmap - you just can’t use it.

I’m assuming you’ve seen the document at https://www.ghielectronics.com/community/codeshare/entry/216 that is the driver? There’s an example there that loads an image from resources in the project, and there’s also an image converter there. Worth taking a look at that…

@ Brett - Thanks! that was my problem! I discarded that converted because I thought that converted was not working but it is working, the problem was the size of the image. It is working fine now :slight_smile:

1 Like