cout << 'I have a '<< '\q' << '\a' << 'images. Is there any possible way to embed//manipulate images to your screen using C++?
lol QBASIC.Code:screen 13
pset(500,500),3
draw "U500 H100 G100 D500 R100"
Printable View
cout << 'I have a '<< '\q' << '\a' << 'images. Is there any possible way to embed//manipulate images to your screen using C++?
lol QBASIC.Code:screen 13
pset(500,500),3
draw "U500 H100 G100 D500 R100"
judging from this, you've got ALOT to learn... but yes... you can't do much with standard C++, but you can use other extensions like OpenGL to create things like Warcraft III...Quote:
Originally Posted by C++Child
Lol, I did the code like that on purpose.Quote:
Originally Posted by major_small
I could correct it like this:
I know everything but structures and linked lists. I might not know structures but I know classes.Code:#include<iostream>
#include<fstream>
#include<conio.h>
int main()
{
char hello[256];
fstream x;
x.open("example.txt", ios::out | ios::in)
x << "I have a \\q \\a images. Is there any possible way to embed//manipulate images to your screen using C++?"
x.getline(hello,256)
cout<<hello;
cout.flush()
getch()
exit (0);
}
But my point is that is there any way to parse images into C++ like the following?
[code]
//*
#include<iostream>
#define getch() getch() //forget about stupid conio.h
#include<imgstream> //img means image && includes ifstream
int main()
{
imgifs zebra;
zebra.kb(500); //calls a function that sets how many kilobytes are to be read.
zebra.b(128); //128 for 128-bit true color
img * zebra4 = &zebra;
img cache; //Cache that xxx.open writes to
zebra.open("zebra.jpg", imgs::jpeg, ios::in; readto = cache)
display.cout << cache; //display, used to display images
display.cout.flush;
getch();
exit(0)
)
}
what the heck are you asking about c++child?
You cant really "directly" "embed' and manipulate images as it were. You need a graphics API.
But my point is that is there any way to parse images into C++ like the following?This is my idea.Code://*
#include<iostream>
#define getch() getch() //forget about stupid conio.h
#include<imgstream> //img means image && includes ifstream
int main()
{
imgifs zebra;
zebra.kb(500); //calls a function that sets how many kilobytes are to be read.
zebra.b(128); //128 for 128-bit true color
img * zebra4 = &zebra;
img cache; //Cache that xxx.open writes to
zebra.open("zebra.jpg", imgs::jpeg, ios::in; readto = cache)
display.cout << cache; //display, used to display images
display.cout.flush;
getch();
exit(0)
)
}
Nope. Unless im wrong.... nope...
Well unless your code works, no. You need to use an API - Application Programming INterface. With languages like C++, people can write commonly use code (like the code to do graphics) and store it in a library, for you to use. An example is SDL (www.libsdl.org), but this is quite lowlevel and complex. I'd recommend something simpler while you're still learning. Try a google search or look for recommendations on the CBoard.
edit: Did you write this code, or do you understand it?
is there any way to do
[code]
#ifndef "All The Frickin Header Files That I Need.h"
#define ALL_OF_THEM_IN_THE_NAME_OF_G-D
#include "All The Frickin Header Files That I Need.h" //I wish the compiler understood this....
img newimage(); //prototype
img newimage()
{
iimgstream hi("C:\\...\\image.jpg");//hi is used for reading
img hi2;
hi.cin(hi2,500, 128); //variable to input data to, 500 kilobytes, 128 bit true color.
return hi2;
#endif
#ifndef <iostream>
#include<iostream>
}
int main()
{
cout<<newimage();
cout.flush()
#endif
return 0;
}
no, you need a Graphics Library. I would suggest Allegro. It would go more like.
Then you would link your compiler to the library. Do some searching on Allegro.cc and see what you can findCode:#include <FrickenGraphicsHeader.h>
void InitializeFrickenGraphicsLibrary()
{
// screen settings blah blah
}
int main()
{
//functions from graphics library to load and draw images
return 0;
}
And just out of pure curiosity... Did you read on a site or in a book or something that /q means question and /a means about? Im just curious as to why you thought this. Im not attacking, I'm just an EXTREMELY curious person.