Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Putting a BMP picture into a game made in BGI.

Is there a way to draw a sprite in paint or another drawing program, then put that picture into a game that I am making in BGI graphics? Any info on this will be very helpful.


Comments

  • : Is there a way to draw a sprite in paint or another drawing program, then put that picture into a game that I am making in BGI graphics? Any info on this will be very helpful.


    First, I would think about abandoning the BGI library if you need speed.It is slow and cumbersome. Yes, it is possible using a program like Window's Paint to put that bitmap picture in your game. You will need the BGI's putpixel routine. Also you should get the image files' format of the image file type you are going to use (bmp,pcx,tga,etc.).

    What you do is read the image file header,its palette information,and then the raw image data.

    Now all you have to do is draw the image data on the screen,at the spot you want,using a putpixel type routine.

    The exact sequence depends on the graphic mode used,the number of bytes per pixel, and the image file type. If you need more info,I have it.





  • : Is there a way to draw a sprite in paint or :another drawing program, then put that picture :into a game that I am making in BGI graphics? :Any info on this will be very helpful.


    :First, I would think about abandoning the BGI :library if you need speed.It is slow and :cumbersome. Yes, it is possible using a program :like Window's Paint to put that bitmap picture :in your game. You will need the BGI's putpixel :routine. Also you should get the image files' :format of the image file type you are going to :use (bmp,pcx,tga,etc.).

    :What you do is read the image file header,its :palette information,and then the raw image data.

    :Now all you have to do is draw the image data on :the screen,at the spot you want,using a putpixel :type routine.

    :The exact sequence depends on the graphic mode :used,the number of bytes per pixel, and the :image file type. If you need more info,I have it.




    What other cheap, but good, graphics programs are there? Where can I get them? Where do I learn how to use them? Also, how exactly do I do the things you said above? I am using VGA mode with only 16 colors (including black) on a 640 by 480 screen. I have only been in one programming class for one year, and I have another one this year. So I don't have very much experience.

    BTW, thanks for the information! I really appreciate it.


  • You can get 320x200x256c and 320x240x256c libs at the URL

    below. They're sprite libs, ie. the don't draw circles, etc,

    just blit sprites. However, if you download the BINARTX program

    at the same area, you can use it to dump PCX files to a much

    more simple format, from which you can display them to the screen.

    However, the library isn't that easy to use, as it uses Seg:Ofs

    rather than pointers.


    URL:http://acheronx.resnet.tamu.edu/home/16bit.htm

Sign In or Register to comment.