Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1366 connectés 

  FORUM HardWare.fr
  Programmation
  C++

  [allegro] image + transparence

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

[allegro] image + transparence

n°573457
Toam
Posté le 22-11-2003 à 21:04:56  profilanswer
 

Lut
 
comment faire une image transparente dans allegro?
Ce serait pour un "jeu" et l'image est en fait le pointeur de la souris...
 
Pour le moment je fait un bmp -> je le met dans un datafile avec Grabber et je le charge dans le jeu...
 
Dans Grabber ya un truc "preserve transparency" mais d'apres l'aide ca a pas l'air d'etre ca...
 
Est ce qu'il y aurais un autre moyen? j'ai rien trouver dans le manuel d'allegro....


Message édité par Toam le 22-11-2003 à 21:34:08
mood
Publicité
Posté le 22-11-2003 à 21:04:56  profilanswer
 

n°573458
Taz
bisounours-codeur
Posté le 22-11-2003 à 21:13:42  profilanswer
 

Toam a écrit :

un "jeux"

:o

n°573462
Toam
Posté le 22-11-2003 à 21:26:46  profilanswer
 

ben oui pour le moment j'ai pas le nivo pour faire des jeux ou des progs tres complexe... je fais juste des "jeux" :D


Message édité par Toam le 22-11-2003 à 21:34:30
n°573464
chrisbk
-
Posté le 22-11-2003 à 21:29:00  profilanswer
 

nan c'etait la faute d'accord qui le choquait j'imagine

n°573474
Toam
Posté le 22-11-2003 à 21:33:58  profilanswer
 

lol lol lol ok j'edit  :whistle:


Message édité par Toam le 22-11-2003 à 21:34:52
n°573494
Joel F
Real men use unique_ptr
Posté le 22-11-2003 à 21:56:21  profilanswer
 

Toam a écrit :

Lut
Est ce qu'il y aurais un autre moyen? j'ai rien trouver dans le manuel d'allegro....


 
http://www.redcoat.net/pics/answer.gif
 
Essaye draw_sprite au lieu de blit

n°573512
Toam
Posté le 22-11-2003 à 22:24:10  profilanswer
 

copie moi 100 fois: I will read the topic before posting :D  
 
mon blem est pas pour blit mais pour un pointeur de souris :sarcastic:...
 
mais bon ca doit aussi marcher les truc de draw_sprite...
vais tester thx en tout cas
 
 
si quelqu'un cherche aussi:
 

Citation :

void draw_sprite(BITMAP *bmp, BITMAP *sprite, int x, int y);  
 
Draws a copy of the sprite bitmap onto the destination bitmap at the specified position. This is almost the same as blit(sprite, bmp, 0, 0, x, y, sprite->w, sprite->h), but it uses a masked drawing mode where transparent pixels are skipped, so the background image will show through the masked parts of the sprite. Transparent pixels are marked by a zero in 256 color modes or bright pink for truecolor data (maximum red and blue, zero green).  
If the GFX_HW_VRAM_BLIT_MASKED bit in the gfx_capabilities flag is set, the current driver supports hardware accelerated sprite drawing when the source image is a video memory bitmap or a sub-bitmap of the screen. This is extremely fast, so when this flag is set it may be worth storing some of your more frequently used sprites in an offscreen portion of the video memory.
 
Warning: if the hardware acceleration flag is not set, draw_sprite() will not work correctly when used with a video memory source image, and the input graphic must always be a memory bitmap!
 
Although generally not supporting graphics of mixed color depths, as a special case this function can be used to draw 256 color source images onto truecolor destination bitmaps, so you can use palette effects on specific sprites within a truecolor program.
 

n°573513
Joel F
Real men use unique_ptr
Posté le 22-11-2003 à 22:26:10  profilanswer
 

certes ...
 
essaye set_mouse_sprite avec un bitmap dont la couleur de transparence est magenta si tu travailles en 32bits ou index 0 en 8bit

n°573515
Toam
Posté le 22-11-2003 à 22:37:20  profilanswer
 

merci j'vais faire ca


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  C++

  [allegro] image + transparence

 

Sujets relatifs
Help me image ....[C++] Win32 boutons image et image de fond
comment integrer cette image(speciale) dans un formupload image sans utiliser balise input file
COMMENT GÉNÉRER UNE MINIATURE CONFORME À UN FICHIER IMAGE INITIAL ?2 questions PHP : Créer une mini-image / comment faire une redirection
(HTML) Comment faire pour que l'image de fond ne se répète pas?Meilleur format image pour un site web
Pb avec CSS et center d'une imageInterdire mise en cache image
Plus de sujets relatifs à : [allegro] image + transparence


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR