Bitmap  0.2
 All Data Structures Files Functions Variables Groups
example1.c
1 
4 
5 #include <display_syscalls.h>
6 #include <stdio.h>
7 #include "bitmap.h"
8 
9 
10 
11 int main()
12 {
13  BITMAP image = Init_BITMAP(); //On créer une variable de type BITMAP et on l'initialise avec la fonction Init_BITMAP();
14 
15  LoadBmp24_to8bits("Example1/A.bmp",&image); //on charge l'image "A.bmp" qui se trouve dans le dossier "Example1"
16  //'image' contient maintenant le sprite codé en 8-bit, pour y accéder il suffit de faire image.sprite8Bit
17  if (image.error8bit == ERR_NOERROR) //si la création de notre sprite en 8-bits s'est bien passé.
18  {
19  Bdisp_AllClr_VRAM(); //on efface l'écran
20  CopySpriteNbitMasked(image.sprite8Bit,0,0,image.width,image.height, image.sprite8Bit_palette,0x0000,8); //on affiche notre sprite
21  Bdisp_PutDisp_DD();//on affiche le contenu de l'écran
22  }
23  Delete_BITMAP(&image); //on supprime l'image
24 
25  LoadBmp24_to16bits("B.bmp",&image); //on charge l'image "B.bmp" qui se trouve dans le même répertoire que l'add-inn.
26  //cette fois-ci 'image' contient maintenant le sprite codé en 16-bit, pour y accéder il suffit de faire image.sprite16Bit
27  if (image.error16bit == ERR_NOERROR) //si la création de notre sprite en 16-bits s'est bien passé
28  {
29  Bdisp_AllClr_VRAM(); //on efface l'écran
30  CopySpriteMasked(image.sprite16Bit,0,0,image.width,image.height,0x0000); //on affiche notre sprite
31  Bdisp_PutDisp_DD();//on affiche le contenu de l'écran
32  }
33  Delete_BITMAP(&image); //on supprime l'image
34 
35 }
void LoadBmp24_to16bits(char *bmp_filename, BITMAP *bmpPicture)
Permet de convertir une image 24bits en un sprite 16bits.
Contient tous les informations d&#39;une image bmp.
Definition: bitmap.h:75
void LoadBmp24_to8bits(char *bmp_filename, BITMAP *bmpPicture)
Permet de convertir une image 24bits en un sprite 8bits.
int error16bit
Definition: bitmap.h:84
int height
Definition: bitmap.h:80
int width
Definition: bitmap.h:79
int error8bit
Definition: bitmap.h:85
Cette bibliothèque permet d&#39;ouvrir des fichier bitmap (.bmp) sur votre calculatrice fx-cg20...
unsigned short sprite8Bit_palette[256]
Definition: bitmap.h:83
unsigned short * sprite16Bit
Definition: bitmap.h:81
void Delete_BITMAP(BITMAP *bmp)
Supprime l&#39;image, très important car la variable BITMAP contient des éléments alloués dynamiquements...
#define ERR_NOERROR
pas d&#39;erreur
Definition: bitmap.h:33
BITMAP Init_BITMAP()
Permet d&#39;initialiser une variable de type BITMAP.
unsigned char * sprite8Bit
Definition: bitmap.h:82