graphics using c

actually i want a program to print any jpeg or bmp or any image fileon to the monitor using graphics in c
plz help me

Comments

  • Removed your e-mail address since code begging is not allowed on these boards. Please read the posting policies before posting.
  • : actually i want a program to print any jpeg or bmp or any image
    : fileon to the monitor using graphics in c
    : plz help me
    :
    :

    Why? The purpose of developing a program is to find a solution to a problem. This problem already has one: the PrtScr key.

    If you still want to develop a program for it, what operating system? (This is very OS dependent). Also, you can easily create codecs for *.bmp and *.jpg (iirc, there is an open source library for it.)

    Not all image formats are possible though. Search google for examples in loading these image types, and wotsit.org - great file format collection site.

    [hr][size=1][leftbr].:EvolutionEngine[rightbr][leftbr].:MicroOS Operating System[rightbr][leftbr][link=http://www.brokenthorn.com]Website :: OS Development Series[rightbr][/link][/size]
  • ok let me make it clear. i am trying to write a piece of code which works like this ok the program displays the pic of an apple and then the user needs to type the name of the object and if it is right then move on tothe next image. now the only problem is to siaplay the image and need to erite a code for this using graphics in c
  • That clears things up a bit. Do you already have the code to display and load the image? As I said in my previous post, it is very system dependent. C and C++ do not have any concept of graphics themselves as it is very system dependent.

    To load the image files, there are several methods. You can either use a library to load the files, or create your own parsers. Creating a codec for *.bmp or *.tga are not too hard to do yourself if you do not want to use libraries.

    I am assuming this is graphical (not text based). If so, to render the image and text on screen is very system dependent. You will need to either directly or indirectly go through the system API - there is no other way.

    Probably the easiest method is to use the Win32 API (Windows native system API).

    [link=http://winprog.org/tutorial/start.html]Win32 API tutorial[/link]

    The above site also contains tutorials for loading and rendering bitmaps using the Win32 Graphical Device Interface (GDI)

    [hr][size=1][leftbr].:EvolutionEngine[rightbr][leftbr].:MicroOS Operating System[rightbr][leftbr][link=http://www.brokenthorn.com]Website :: OS Development Series[rightbr][/link][/size]
  • thanks a lot!! well the os is windows xp and unfortunately i dont have the codecs mentioned by you.i would be greatful if you can help me to write the codecs and send me a link where i can get the required header files

  • You might not need to create a codec for loading *.bmp files. The Win32 API includes a LoadImage() routine that may be used for that. (It is shown in the GDI portion of the tutorial I linked you to)

    If you have a visual express edition, you may need to download and set up the Win32 PSDK in order to use the Win32 API.

    If you dont have a windows.h header file, download the psdk from [link=http://www.microsoft.com/downloads/details.aspx?FamilyId=E6E1C3DF-A74F-4207-8586-711EBE331CDC&displaylang=en]here[/link].

    After installing it, you qill need to set your compiliers INCLUDE and LIB paths to point to the win32 INCLUDE and LIB directories.

    [hr][size=1][leftbr].:EvolutionEngine[rightbr][leftbr].:MicroOS Operating System[rightbr][leftbr][link=http://www.brokenthorn.com]Website :: OS Development Series[rightbr][/link][/size]
  • : oh ok thanks!!
    :

Sign In or Register to comment.

Howdy, Stranger!

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

Categories