I need to display a simple .gif image in C++

Posted on 2003-02-27
Medium Priority
Last Modified: 2013-11-19
This may be a very novice question, I'm not sure.  Currently I am taking a basic C++ programming class, and we are required to make a game.  I would like to include .gif images in it.
The problem is this: every solution that I have found on the net will only display the image if the program is made into a binary executable file.  I am running Borland Turbo C++ 3.0.  The image is usually distorted when I run the program straight from Turbo, or I recieve many errors.  It runs fine from an executable.  I would like to know why this occurs, if it's not too much trouble.  Is there a way that I can work around this, or is Turbo an inadequate application for this purpose?  Thank you in advance for any responses.
Question by:zshipley
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Accepted Solution

sparticus1701 earned 150 total points
ID: 8035525
You won't have much luck.  GIF is a patented format, so usually, unless you can find someone posting code to read the files (which is technically illegal), you'll have to purchase a 3rd party reader which usually comes with the licensing from UNISYS.

Turbo C++ is also not going to be very accomodating for this either.

I used to use Turbo C++ for DOS in high school, and to facilitate using nicer graphics than line/point/circle, I cracked the BMP format, and then converted them to my own format which I could render easily.

There should be extensive information on the graphics format on the web.  There's probably also info on JPG, but that is a much more complicated format, and harder to code.

Expert Comment

ID: 8035531
If you are going to make a Game, I could recomend you to use Bitmaps instead. All my games are developed with Bitmaps, But the games does just run under Windows, so if you are going to write it for Linux or some other, use PING.

So if I where you, I would reconsider the choose of gif images.

Author Comment

ID: 8035588
Thank you for your fast response.

Expert Comment

ID: 8035668

This explains the BMP format and has some sample code.

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
Learn how to set up basic frames and paths in Prezi and understand the open space that Prezi allows you to create presentations in.
Not only does Prezi allow you to create non-linear presentations, it also makes it easy to apply transition animations between your frames. Learn how to apply a fade-in transition to select items and entire frames in this tutorial Select "Edit Path"…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question