   how to make a raw file
  as we all know,we use raw to store the little-volume pic.but i don''t know the answer to a basic problem.i can find a tutorial about raw-loading easily ,but i still don''t how i can make a raw file.it is binary stream,but if i can get just change the filename to carry my point?or there is some way for us to make a bmp(or jpeg etc.)into raw?i know this question may be a bit stupid,but i really want to know the answer.thank u.    jerry2Programming,make a whole new world.  
  To answer your questioon, yes it is possible.  Find the format of a bitmap or jpeg, load it up and then extract the actual pixel data values.  ;  Raw files are just a byte dump, so a 24bit rgb image is a list of width*hieght*3 bytes.  To find any pixel in the file, it starts at x*width+y*width*3 and spans 3 bytes: 1 byte red, 1 byte green, 1 byte blue.  Photoshop saves straight into raw.  The easiest way to get raw data otherwise is from a 24 bit uncompressed bmp file -- just strip off the BITMAPFILEHEADER and BITMAPINFOHEADER and the rest of the data are the pixels. Example, a 50x100 24 bit image is:50x100x3 bytes in size.pixel (1,1) is located at offset 1*3+1*50*3.Loading a raw file:   char* buffer = new char [width * hieght *bytesPerPixel];std::ifstream file;file.open (filename, std::ios::binary );file.read ( (char *)buffer,  width * hieght *bytesPerPixel);file.close();  convert bmp to raw:   char* buffer = new char [width * hieght *bytesPerPixel];std::ifstream file;file.open (filename, std::ios::binary );//trash the headersfile.read ( (char *)buffer,  sizeof(BITMAPFILEHEADER) );file.read ( (char *)buffer,  sizeof(BITMAPINFOHEADER) );file.read ( (char *)buffer,  width * hieght *bytesPerPixel);file.close();std::ostream output;output.open (filename, std::ios::binary );output.write ( (char *)buffer,  width * hieght *bytesPerPixel);output.close ();  ;  www.wotsit.org  ;  to David_Kay:thanks,i have knowed the true concept of the raw.to invective:excuse me,u mean we can use photoshop to create raw directly?to Anonymous Poster:ok.thanks for yr url. jerry2Programming,make a whole new world.  ;  yes. just choose file->save as, and change the type to raw -- i suggest you do image->mode->grayscale first, so you get only 1 byte per pixel or image->mode->RGB if you want 3 bytes per pixel.  Photoshop will prompt you for a header when you want to save -- just ignore it and hit ok.  ;  Remember .RAW files can get very big in size, but then again.. most people have +4GB hard drives =).    ;  to invective:thanks for yr help,i have understood all these completely.to GoofProg:do u mean raw isn''t a good file format for game?but what kind of format is more suitable?    jerry2Programming,make a whole new world.  ;  If you are concerned about file size, consider PNG files (you can make these in photoshop too and they have good lossless compression).  You can find code to support PNG here: http://libpng.sourceforge.net/  ;  OK.thank u.then i have aother question,which format is the most popular,or the perfect(combination of size,quality and feature) one nowadays?    jerry2Programming,make a whole new world.  