Images

Créations

strangenikolai

NEW il y a 6 ans

Sorunome Sorunome

Do you know what the upper size of the bitmap can be? If I make it really small it works, but over a certain size it just shows as a black box. I haven't quite narrowed down the size that breaks.

Sorunome

il y a 6 ans

well, bmp images are loaded into ram, so you need at least enough ram

Sorunome

NEW il y a 6 ans

strangenikolai strangenikolai

well, bmp images are loaded into ram, so you need at least enough ram

Mokona

NEW il y a 6 ans

Hello,

it seems that in the XLS file in the GamebuinoPalette.zip file describing the colors, PINK (from the source) is called MAGENTA.


Aurélien Rodot

il y a 6 ans

Thanks, I'll fix that :)

Aurélien Rodot

NEW il y a 6 ans

Mokona Mokona

Thanks, I'll fix that :)

Adamko

NEW il y a 6 ans

Bonjour , j'ai une image bitmap mais je sais pas comment la mettre dans le programme.

Sorunome

il y a 6 ans

The section "Flash Image" explains how to do that. If you are still confused, would you please mind saying more specifically where you are stuck?

Sorunome

NEW il y a 6 ans

Adamko Adamko

The section "Flash Image" explains how to do that. If you are still confused, would you please mind saying more specifically where you are stuck?

Adamko

il y a 6 ans

comment savoir si on a une image uint8_t ou uint16_t?

Adamko

NEW il y a 6 ans

Sorunome Sorunome

comment savoir si on a une image uint8_t ou uint16_t?

Sorunome

il y a 6 ans

In the conversion tool linked. if you specified "indexed" it'll be uint8_t, else it'll be uint16_t.

Sorunome

NEW il y a 6 ans

Adamko Adamko

In the conversion tool linked. if you specified "indexed" it'll be uint8_t, else it'll be uint16_t.

Adamko

il y a 6 ans

ca change quoi?

Adamko

NEW il y a 6 ans

Sorunome Sorunome

ca change quoi?

Sorunome

il y a 6 ans

Indexed images use a palette, by default the gamebuino palette. They are smaller in size.

RGB565 images are basically full color.

Sorunome

NEW il y a 6 ans

Adamko Adamko

Indexed images use a palette, by default the gamebuino palette. They are smaller in size.

RGB565 images are basically full color.

Adamko

il y a 6 ans

l'ide me dit qu'il y a une erreur de compilation.

Adamko

il y a 6 ans

c moi dit:

# include <Gamebuino-Meta.h> 

const uint8_t myImgBuf [] = { 
   8, 8, // largeur, hauteur 
  1, 0, // frames 
  0, // boucle d'image 
  0xFF, // couleur transparente 
  1, // Mode couleur 

  0x07, 0x07, 0x07, 0x07, 
   0x70, 0x70, 0x70, 0x70, 
   0x07, 0x07, 0x07, 0x07, 
   0x70, 0x70, 0x70, 0x70, 
   0x07, 0x07, 0x07, 0x07, 
   0x70, 0x70, 0x70, 0x70, 
   0x07, 0x07, 0x07, 0x07, 
   0x70, 0x70, 0x70, 0x70, 


Image myImg (myImgBuf); sur cette ligne ca me dit "expected ',' or ';' before 'Image'"

void setup () { 
  gb.begin (); 


void loop () { 
   while (! gb.update ()); 
  gb.display.clear (RED);
 
  // dessine l'image 
  gb.display.drawImage (10, 10, myImg); 
}



Adamko

NEW il y a 6 ans

Sorunome Sorunome

l'ide me dit qu'il y a une erreur de compilation.

Adamko

NEW il y a 6 ans

Sorunome Sorunome

c moi dit:

# include <Gamebuino-Meta.h> 

const uint8_t myImgBuf [] = { 
   8, 8, // largeur, hauteur 
  1, 0, // frames 
  0, // boucle d'image 
  0xFF, // couleur transparente 
  1, // Mode couleur 

  0x07, 0x07, 0x07, 0x07, 
   0x70, 0x70, 0x70, 0x70, 
   0x07, 0x07, 0x07, 0x07, 
   0x70, 0x70, 0x70, 0x70, 
   0x07, 0x07, 0x07, 0x07, 
   0x70, 0x70, 0x70, 0x70, 
   0x07, 0x07, 0x07, 0x07, 
   0x70, 0x70, 0x70, 0x70, 


Image myImg (myImgBuf); sur cette ligne ca me dit "expected ',' or ';' before 'Image'"

void setup () { 
  gb.begin (); 


void loop () { 
   while (! gb.update ()); 
  gb.display.clear (RED);
 
  // dessine l'image 
  gb.display.drawImage (10, 10, myImg); 
}



clement

il y a 6 ans

C est parcequ il manque un ; juste avant Image ;)  

const uint8_t myImgBuf [] = { 
   8, 8, // largeur, hauteur 
  1, 0, // frames 
  0, // boucle d'image 
  0xFF, // couleur transparente 
  1, // Mode couleur 

  0x07, 0x07, 0x07, 0x07, 
   0x70, 0x70, 0x70, 0x70, 
   0x07, 0x07, 0x07, 0x07, 
   0x70, 0x70, 0x70, 0x70, 
   0x07, 0x07, 0x07, 0x07, 
   0x70, 0x70, 0x70, 0x70, 
   0x07, 0x07, 0x07, 0x07, 
   0x70, 0x70, 0x70, 0x70, 
} ; //<<<<<<<<<<<<<<<<<<<<<--------------- celui la de point virgule 


Il faut bien lire les messages d erreurs souvent ils aident bien :)

++

clement

NEW il y a 6 ans

Adamko Adamko

C est parcequ il manque un ; juste avant Image ;)  

const uint8_t myImgBuf [] = { 
   8, 8, // largeur, hauteur 
  1, 0, // frames 
  0, // boucle d'image 
  0xFF, // couleur transparente 
  1, // Mode couleur 

  0x07, 0x07, 0x07, 0x07, 
   0x70, 0x70, 0x70, 0x70, 
   0x07, 0x07, 0x07, 0x07, 
   0x70, 0x70, 0x70, 0x70, 
   0x07, 0x07, 0x07, 0x07, 
   0x70, 0x70, 0x70, 0x70, 
   0x07, 0x07, 0x07, 0x07, 
   0x70, 0x70, 0x70, 0x70, 
} ; //<<<<<<<<<<<<<<<<<<<<<--------------- celui la de point virgule 


Il faut bien lire les messages d erreurs souvent ils aident bien :)

++

Adamko

il y a 6 ans

ca fonctionne super bien. merci. je suis allé jeter un coup d'oueil a save the princess

Adamko

NEW il y a 6 ans

clement clement

ca fonctionne super bien. merci. je suis allé jeter un coup d'oueil a save the princess

sautax

NEW il y a 5 ans

Is there a way to delete the images in ram (when i no more need them)

Sorunome

il y a 5 ans

If the image object is deleted then the associated ram buffer is deleted, too.

Deletion of that happens e.g. if they are scoped locally or with the delete keyword, in case of pointers

void someFunc() {
    Image img(/* blah *);
    // do stuff

    // image gets deleted as it is end of the function
}
Image* img_ptr;

void init() { img_ptr = new Image(/* stuff */); } // later on in your code delete img_ptr;


Please note that that can easily cause ram fragmentation