adding image on console using c++

Nov 12, 2015 at 3:06pm
how do I add a simple bitmap image in my program? I'm creating a database using c++ on visual studio 2012 I just need to insert a picture on console at the start of program? is there any code for that?
Nov 12, 2015 at 10:30pm
I have no Idea. Have you looked to google for help?
Nov 13, 2015 at 1:55pm
yes I cannot find any solution
Nov 13, 2015 at 2:18pm
You cannot display an image in the console.

https://en.wikipedia.org/wiki/Console_application
Nov 13, 2015 at 2:22pm
That was my thought, too. I remember in the old days of DOS, it was possible to display images, or even videos, in a DOS console. But the modern Windows command line isn't proper DOS, and I'd be really surprised if you could still do that.
Nov 13, 2015 at 10:54pm
Nov 14, 2015 at 10:36am
Ah, interesting. Thanks, Duoas - I withdraw my comment :)
Nov 14, 2015 at 1:41pm
Don't. Your comment is correct.

While it is possible to actually draw pixels on the console window... it is really only by cheating and it isn't actually useful for more than a parlor trick. That is, maintaining an image on the console is more trouble than it is worth.

Just create a new window and display the image that way.
Nov 15, 2015 at 7:29am
i don't know any way to display images on console, but in my idea it is best to have a window and show your image on it
conio has ability to change console's color, but nothing about images
Nov 15, 2015 at 7:09pm
I has solution:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <graphics.h>
#include <dos.h>

int main()
{
   int i, j = 3, gd = DETECT, gm;

   initgraph(&gd,&gm,"C:\\TC\\BGI");

   settextstyle(COMPLEX_FONT,HORIZ_DIR,2);
   outtextxy(45,240,"   Press any key to view the moving car");
      getch();
    settextstyle(COMPLEX_FONT,HORIZ_DIR,1);
   for( i = 0 ; i <= 420 ; i = i + 10, j++)
   {
      rectangle(50+i,275,245+i,400);
      outtextxy(65+i,280,"J's Bussing Inc.");
      rectangle(255+i,355,285+i,370);
      rectangle(245+i,350,295+i,400);
      circle(75+i,410,10);
      circle(225+i,410,10);
      setcolor(j);
      delay(100);

      if( i == 420 )
         break;
      if ( j == 3 )
         j = 2;

      cleardevice(); /// clear screen
   }

   delay(1500);
   closegraph();
   return 0;
}

This code utilises the graphics.h header file with Windows BGI.
Nov 15, 2015 at 7:21pm
I has solution:

Except that it doesn't address the question in the OP at all.
Nov 15, 2015 at 11:26pm
-_- I meant... use the winbgim header file. It allows for images and animations to popup and close by key presses.
Topic archived. No new replies allowed.