delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/14/18:16:48

From: Bjorn Hansen <viking AT xyz DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: displaying a bmp
Date: Fri, 14 Aug 1998 14:06:47 -0800
Organization: ISPNews http://ispnews.com
Lines: 51
Message-ID: <35D4B4F6.EE9DE3BF@xyz.net>
References: <35D2B912 DOT 3F40D6C8 AT xyz DOT net> <35D30756 DOT 63EEF1F3 AT unb DOT ca>
NNTP-Posting-Host: hom-1-9.xyz.net
Mime-Version: 1.0
NNTP-Posting-Date: 14 Aug 1998 22:08:51 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp


Endlisnis wrote:

> Bjorn Hansen wrote:
>
> > void set_mode(int mode)
> >      {
> >      __dpmi_regs r;
> >      r.x.ax = mode;
> >      __dpmi_int(0x10, &r);
> >      };
> >
> > void main()
> > {
> >  char smiley[320*200];
> >  FILE *pict= fopen("C:\\Cstuff\\smibm.bmp","rb");
> >  set_mode(VGA_13h);
> >
> >  dosmemput(pict+128,320*200,0xA0000);
> >  while(!kbhit());
> >  set_mode(TEXT);
> > }
>
> 1]    Your set_mode function should have a line like:
>       memset(&r, 0, sizeof(r));
>       or you might get unexpected (and undesired) results occationally.

Why? what does this do?

>
>
> 2]    All you've done is open the file, you never read any data from it.

ok how is this done?

> 3]    Bitmap files are not just a series of pixel values, they have many
> different possible     styles (and bit-depths), and some are even
> run-length
> encoded and stuff like that.  You can't just read it directly to the
> screen,
> you have to interpret the data.  And you also have to worry about palettes.

So where can I find out how bmps are stored or maybe a pcx or rle file would be
easier?why should I worry about the palette yet. if it is not the right palette
won't the colors just be wrong but hte same image will come up?  the thing I am
trying to display is very simple and only has 3 colors.


Bjorn

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019