Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

How to load a bmp?????

Merc22Merc22 Member Posts: 1
is there a way i can load and display with C++ alone(no other things like directx or allegro) in dos??

thanx

Comments

  • ColdShineColdShine Member Posts: 597
    If you're under Windows, it's 1 line, else about 100...
    _____________________________
    [size=1][b][grey]Cold[/grey][blue]Shine[/blue][/b]
    http://www16.brinkster.com/rafonline[/size]


  • (TNT)(TNT) Member Posts: 98
    Hey,

    You said you can do it in 1 line in windows, how do you do that.

    Thanks


  • CocaColaCocaCola Member Posts: 48
    HBITMAP bitmap; //The bitmap

    //hInst is the WinMain HINSTANCE parameter
    bitmap = LoadBitmap(hInst,"bitmap.bmp"); //Load 'bitmap.bmp' to 'bitmap'




    [b][size=3][red]CocaCola[/red][/size][/b]
    [italic]ICQ:[/italic] [blue]50302279[/blue]
    [italic]E-mail:[/italic] [email protected]


  • semperfisemperfi Member Posts: 48
    : HBITMAP bitmap; //The bitmap
    :
    : //hInst is the WinMain HINSTANCE parameter
    : bitmap = LoadBitmap(hInst,"bitmap.bmp"); //Load 'bitmap.bmp' to 'bitmap'
    :
    Once its loaded, how do you display it?


  • SunlightSunlight Member Posts: 186
    : You said you can do it in 1 line in windows, how do you do that.

    Use LoadImage.

    LoadImage(NULL, filename, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
    --
    [italic][blue]Sunlight[/blue][/italic]


  • gautamgautam Member Posts: 642
    You get the bmp file structure in www.wotsit.org and use the info there to figure out how to load it.

    Most files can be loaded if you know their structure.



Sign In or Register to comment.