位图-短代码-IMO应该可以,但不能.为什么? [英] Bitmaps - short code - IMO should work, yet doesn't. why?

查看:76
本文介绍了位图-短代码-IMO应该可以,但不能.为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

#include <iostream>
#include <windows.h>

using namespace std;

HBITMAP hBitmap[3];
BITMAP  bmp;
int     cardwidth, cardheight;


int main(HINSTANCE hInst){
    

    hBitmap[0] = LoadBitmap(hInst, "..\\images\\test.bmp");
    hBitmap[1] = LoadBitmap(hInst, "..\\images\\test2.bmp");
    hBitmap[2] = LoadBitmap(hInst, "..\\images\\test3.bmp");
 cout << hBitmap[0] << hBitmap[1] << hBitmap[2];
 system("pause");


    // find the bitmap dimensions

    GetObject(hBitmap[0], sizeof(bmp), &bmp);

    cardwidth  = bmp.bmWidth;
    cardheight = bmp.bmHeight;

    DeleteObject(hBitmap[0]);
    DeleteObject(hBitmap[1]);
    DeleteObject(hBitmap[2]);

}

推荐答案

int main(HINSTANCE hInst)



C/C ++不支持main的签名.也许这就是您的问题(无论是什么,因为您没有提到它是什么).



C/C++ does not support that signature for main. Perhaps that''s your problem (whatever it is, since you haven''t mentioned what it is).


这篇关于位图-短代码-IMO应该可以,但不能.为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆