Howdy, Stranger!

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

Categories

How do you put pictures in games in C++??

Does anyone know hopw to do this. All i want is a simple picture. Like a logo. thanks in advance.


Comments

  • : Does anyone know hopw to do this. All i want is a simple picture. Like a logo. thanks in advance.


    Do you mean a prc picture or what....





  • : Does anyone know hopw to do this. All i want is a simple picture. Like a logo. thanks in advance.


    Do you mean a prc picture or what....





  • no i mean like a bmp file or pcx


  • : no i mean like a bmp file or pcx


    well, PCX and BMP are mostly RLE encoded. There should be thousands of documents about decoding RLE pictures. PCX is quite simple. If you want to decode a 256 color pcx for example:


    1) the 128 bytes are header. look the fileformat up somewhere. If you already know the size, skip these bytes.

    2) the picture data. It's compressed like this: if the upper two bits of a byte are not set, just plot that color and go on to the next. If they are set, then the lower 6 bits contain the number of pixels you need to plot. The next byte in the file will indicate the color they need to be.

    3) the last 3*256 bytes are palette.


    that's about it. 24bit PCX files are just the same, but they miss the palette data (obviously), and they are one horizontal line of R values, then one line of G values, and then one of B values. These three lines make up one scanline of picture data.


    Like I said, just leech some doc on this.


    /inopia


  • : Does anyone know hopw to do this. All i want is a simple picture. Like a logo. thanks in advance.





Sign In or Register to comment.