Chinaunix首页 | 论坛 | 博客
  • 博客访问: 8318760
  • 博文数量: 1413
  • 博客积分: 11128
  • 博客等级: 上将
  • 技术积分: 14685
  • 用 户 组: 普通用户
  • 注册时间: 2006-03-13 10:03
个人简介

follow my heart...

文章分类

全部博文(1413)

文章存档

2013年(1)

2012年(5)

2011年(45)

2010年(176)

2009年(148)

2008年(190)

2007年(293)

2006年(555)

分类: C/C++

2006-11-24 23:14:41

1、加载位图
void loadBkground()
{
 bmpbackground="http://www.blog.com.cn/load_bmp"("img/bk.bmp",NULL);
 if(!bmpBackground)
 {
  set_gfx_mode(GFX_TEXT,0,0,0,0);
  allegro_message("read img/bk.bmp error");
 }
 set_color_depth(32);
 bmpSprite=create_bitmap(bmpBackground->w,bmpBackground->h);
 //blit(bmpBackground,bmpSprite,0,0,0,0,bmpBackground->w,bmpBackground->h);

 blit(bmpBackground,screen,0,0,0,0,bmpBackground->w,bmpBackground->h);
 
}

void deleteBmp()
{
 destroy_bitmap(bmpBackground);
 destroy_bitmap(bmpSprite);
}
2、显示透明位图
void masked_blit(BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height);
3、缩放贴图
void stretch_blit(BITMAP *source, BITMAP *dest, int source_x, source_y, source_width, source_height, int dest_x, dest_y, dest_width, dest_height);
4、设置鼠标在某一状态的形状
set_mouse_cursor_bitmap(MOUSE_CURSOR_ARROW,bmpChui);
select_mouse_cursor(MOUSE_CURSOR_ARROW);
show_mouse(screen);
5、设置位图鼠标
 set_mouse_sprite(bmpChui);
 show_mouse(screen);
6、调用一个时间过程
int install_int(void (*proc)(), int speed);
7、延时
void rest(unsigned int time);
8、生成颜色
int makecol(int r, int g, int b);
9、显示字符
显示固定字符void textout_ex(BITMAP *bmp, const FONT *f, const char *s, int x, int y, int color, int bg);
显示变动字符void textprintf_ex(BITMAP *bmp, const FONT *f, int x, int y, int color, int bg, const char *fmt, ...);

阅读(2112) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~