Display image on V5 using vex code

Hey i was looking for a way to display an image on the v5 using SD card on Vex Code

Brain.Screen.drawImageFromFile( "myimage.bmp", 100, 100 );

display the image “myimage.bmp” with the top left corner at location 100, 100

only bmp and png images are able to be displayed.

5 Likes

Also the screen size is 480 x 272, so you would need to resize images accordingly to fit that resolution.
@jpearman do .gifs work in vexcode?
(Sorry for so many edits im struggling on my phone)

5 Likes

Not directly, there a demo here (that needs updating for the latest SDK features) that used animated gifs

3 Likes

so all i gotta do is put this on my existing code and name the file same as myimage.bmp and put it on a sd card ?

replace “myimage.bmp” with the name of you image file on the SD card.
make sure the image is less than 480 x 272 (although it will still be cropped to 240 pixels heigh)

so if you image is called “sahil.png” and fills the screen use

Brain.Screen.drawImageFromFile( "sahil.png", 0, 0 );
7 Likes