c语言编译load,Loadimage函数装载资源中位图文件如何改写?

回复 4楼 rjsp

#include

#include //图形界面的头文件

#include

#include

#include //多媒体设备接口

#include "resource.h"

#include

#pragma comment(lib,"winmm.lib")

#define NUM 13  //十三个烟花

struct FIRE

{

int r;

int max_r;

int x, y;

int cen_x, cen_y;

int width, height;

int xy[240][240];

bool isShow;

bool isDraw;

DWORD t1, t2, dt;

}Fire[NUM];

struct JET

{

int x, y;    //烟花弹的坐标

int hx, hy;    //烟花弹的最高点的坐标

int height;    //当前烟花弹的坐标与最高点坐标的差

bool isShoot;

DWORD t1, t2, dt;    //发射的时间间隔

IMAGE img[2];    //2张 暗色的 亮色

byte n : 1;    //2张图片的下标  位段  byte n  位 1 int 32 -21亿---21亿

}Jet[NUM];

void Welcome()

{

//播放背景音乐

//MP3格式用下面语句

//mciSendString("open ./fire/小幸运.mp3 alias bk", 0, 0, 0);

//mciSendString("play bk repeat", 0, 0, 0);

//WAV格式用下面语句

PlaySound((LPCTSTR) IDR_WAVE1, NULL, SND_RESOURCE | SND_LOOP | SND_ASYNC);

setcolor(YELLOW); //让文字动起来  x y  学习这些函数 C语言9大控制结构

for (int i = 0; i < 50; i++) //i这个控制变量得到x y

{

//600 200 需要得到的圆的圆心

//180 圆的半径

//60  是圆轨迹上的60个点

int x = 600 + int(180 * sin(3.1415926548 * 2 * i / 60));

int y = 200 + int(180 * cos(3.1415926548 * 2 * i / 60));

cleardevice();    //每一次循环都把屏幕清除掉

settextstyle(i, 0, "楷体");

outtextxy(x, y, "双十一,不剁手");

outtextxy(x - 100, y + 80, "写段代码");

Sleep(30);

}

getchar();  //等待键盘的输入

cleardevice();

settextstyle(25, 0, "楷体");

outtextxy(400, 200, "XXXXXXXXXXXXXX");

outtextxy(400, 250, "XXXXXXXXX");

outtextxy(400, 300, "XXXXXXXXXXXXXX");

outtextxy(400, 350, "XXXXXXXXXXXXXXXX");

outtextxy(400, 400, "XXXXXXXXX");

outtextxy(400, 450, "XXXXXXXXXXXXX");

outtextxy(400, 500, "XXXXXXXXXXXXXXX");

outtextxy(600, 550, "----");

getchar();

}

//加载图片

void Load()

{

//加载烟花

IMAGE fm, gm;

loadimage(&fm, L"./images/flower.jpg");//加载图片

for (int i = 0; i < NUM; i++)

{

SetWorkingImage(&fm);  //工作---对象是一张图片

getimage(&gm, i * 240, 0, 240, 240);

SetWorkingImage(&gm);  //工作---对象是一张图片

for (int a = 0; a < 240; a++)

{

for (int b = 0; b < 240; b++)

{

fire[i].xy[a][b] = getpixel(a, b);

}

}

}

就是这里面的一句如何替换?LoadImage(hInst, MAKEINTRESOURCE(IDB_BMP1), IMAGE_BITMAP, 0,0, 0)直接替换也不行,很多未定义的标识符,差什么语句或者头文件呀

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值