Mail Archives: djgpp/1998/06/24/04:45:24
> In the following code, when I attemp to load a 24bit, 320*200 file and
place
> on the screen it returns after puting only about 750 pixles. Also I know
> this because if I skip the eof() test it will make 90% of the screen
white.
> (could be lightest gray). The file that I am loading is one saved by PSP
4
> in the RAW format ( 24bit, ordered, not flipped RRGBRGBR...)
> void Raw::Load(char * Name, int dx = 320, int dy = 200, int tx=0, int
ty=0)
> {
> char r,g,b,rgb;
> ifstream temp(Name);
Try some like 'ifstream temp(Name,ios::in|ios::binary);' The stream is
opened in text mode
by default (perhaps, this default behavior can be changed) and the first
occurence of
0x26 (to my mind) code is considered as eof. If you insist to read the
stream even if
the ifstream object thinks that it is eof, -1 value is returned and looks as
lightest gray
(white) on the screen.
----------------------------------------------------------------------
Aleksey Kondratyev
Ph.D. student of Ulyanovsk state University, Russia
http://www.mv.ru/~akondra
E-mail akondra AT mmf DOT univ DOT simbirsk DOT su
akondra AT mv DOT ru
If the address above contains no-spam-, please,
remove it when replying.
- Raw text -