1. VIEWING bmp FILES
- Posted by Daniel W Garrett <deathwarrior at JUNO.COM> Dec 20, 1996
- 1566 views
How do I tell euphoria to display a bmp file in one a program?
2. Re: VIEWING bmp FILES
- Posted by Vic <cybrgod at IBM.NET> Dec 20, 1996
- 1543 views
- Last edited Dec 21, 1996
At 01:42 PostMer 12/20/96 EST, Daniel W Garrett wrote: >---------------------- Information from the mail header ----------------------- >Sender: Euphoria Programming for MS-DOS <EUPHORIA at >MIAMIU.ACS.MUOHIO.EDU> >Poster: Daniel W Garrett <deathwarrior at JUNO.COM> >Subject: VIEWING bmp FILES >------------------------------------------------------------------------------- > >How do I tell euphoria to display a bmp file in one a program? It's pretty simple: include image.e --include file include graphics.e --include file sequence s --this is the variable that will be used to read the bmp file s=read_bitmap("c:\\windows\\arcade.bmp") --the bitmap to be read, must use double '\'s --in order to achieve reading from a different --directory all_palette(s[1]/3) --use this to set the palette, see below(1) integer mode --used so the graphics mode can be changed mode=graphics_mode(257) --sets the graphics mode to 640x480x256, see graphics.e display_image({0,0}, s[2]) --see below(2) while get_key() = -1 do --waits for keypress end while and quits if graphics_mode(-1) then default graphics mode end if ------------------------- 1) The all_palette routine is used to set the palette to display the image You can do without it but if you use PaintBrush to make the bmp, the colors come out wrong, so it is necessary. Since the variable 's' is a sequence it has two parts and in this case the first is the length of the palette s[1], and the other is the actual image s[2]. (please correct me if i am wrong) 2) This displays the actual image on to the screen. The {0,0} are the coordinates. The s[2] contains the image info. (please correct me if i am wrong) Hope this helps, Vic. _________________________________________________________________ | http://www.geocities.com/SiliconValley/Heights/8858/home.htm | | It's so difficult to work in groups when you are omnipotent. -Q |