Mail Archives: djgpp/2000/05/26/02:01:53
Thanx a lot!!!!!!!!!!!!!!!
Krogg <krogg DOT no DOT to DOT spam AT gtcom DOT net> skrev i
diskussionsgruppsmeddelandet:392D5317 DOT 27751FA1 AT gtcom DOT net...
> Fredrik Persson wrote:
> >
> > Hi i tried to set_pelette after loading the bitmap but it still just
returns
> > a black screen..
> >
> > {
> > allegro_init();
> > install_keyboard();
> > set_gfx_mode(GFX_VGA, 320, 200, 0, 0);
> > PALETTE p;
> > screen=load_bitmap("drop.bmp",p);
> > set_palette(p);
> > readkey();
> > allegro_exit();
> > }
> >
> > what is wrong??
>
> you are changing where `screen' points to,not sending the
> picture to the screen.....
>
> you need to declare a pointer to the picture and load
> the picture with that pointer and then BLIT it to the screen.
>
> Here is the changes assuming you are using c.
>
>
> {
> PALETTE p;
> BITMAP *MY_PICTURE; file://reserve a pointer for your picture
> allegro_init();
> install_keyboard();
> set_gfx_mode(GFX_VGA, 320, 200, 0, 0);
> MY_PICTURE=load_bitmap("drop.bmp",p); file://load your picture
> set_palette(p);
> blit(MY_PICTURE,screen,0,0,0,0,319,199);//blit to screen
> readkey();
> allegro_exit();
> }
>
> Hope that helps you
>
> (If anyone sees my canceled post,i had forgot to make a pointer
> out of `MY_PICTURE')
> --
>
>
> |"""""<`.THE PRINCE ,'>"""""""""""""""""""""""""""""""""""|
> | `.`/""""""\,',' my sig is too big, |
> |SEE HIS ( / \ \' SEE HIS but its really cool. |
> | FACE \/<> <>\/ SMILE |
> | / W \ Visit my ascii art site: |
> | ,'\_|||||_/`. http://www.gtcom.net/~krogg/ascii/ |
> | ,',' ||| `.`. krogg DOT no DOT to DOT spam AT gtcom DOT net |
> |____<,' TIME TO DIE `.>____Remove no.to.spam to reply____|
- Raw text -