How to load a bmp????? - Programmers Heaven

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 Posts: 1Member
is there a way i can load and display with C++ alone(no other things like directx or allegro) in dos??

thanx

Comments

  • ColdShineColdShine Posts: 597Member
    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) Posts: 98Member
    Hey,

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

    Thanks


  • CocaColaCocaCola Posts: 48Member
    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 Posts: 48Member
    : 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 Posts: 186Member
    : 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 Posts: 642Member
    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.