Having troubles displaying gifs

I decided to try to get gifs implemented into my VexCODE project, although it’s giving me the error “[clang] No member named ‘Gif’ in namespace ‘vex’” I would appreciate any help if anyone knows what the problem is and how to fix it. Here’s the code I used:

vex::brain       Brain;

int main() {
    int count = 0;
   
    vex::Gif gif("world.gif", 120, 0 );
  
  while(1) {
    Brain.Screen.printAt( 5, 230, "render %d", count++ );
    Brain.Screen.render();
  }
}

Did you include “vex.h” and “gifclass.h” at the beginning of your program?

See attached example in this topic: Animated GIF Demo (VEXcode)

vex::Gif class is not a part of the default VEXcode API: https://api.vexcode.cloud/v5/html/annotated.html

PNG and BMP images can be drawn with drawImageFromFile(): https://api.vexcode.cloud/v5/html/classvex_1_1brain_1_1lcd.html#ac1a069baa3212a8c697d70c8fa8e5187

See example here: Drawing Image on V5 Screen

3 Likes

While attempting the “gifclass.h” I could not figure out the proper way or place to declare this. Could you go into more detail on how to implement this declaration? It just kept giving me the error: “[clang] ‘gifclass.h’ file not found”

Animated GIF Demo (VEXcode) has an attached gifdemo.zip file with full example code. When you unzip it, you will find gifdemo.h and gifdemo.cpp files as the part of the project. If you open the main file, you will see an include statement at the top that imports vex::Gif class with

#include "gifdemo.h"

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.