Re: Features and a Question
- Posted by Hawke <mdeland at NWINFO.NET> Sep 08, 1998
- 528 views
Nate Brooman wrote: >First, the question. Can I display high or true colour >JPGs in Euphoria? Has anybody written any routines for >this? I don't know where to start anyways. as far as I know, JPG's aren't implemented yet, in any of the available libraries. However! you can get true color if you are willing to use Targa. If (for ex.) you use paintshoppro, simply make your resulting images in the 24bit, uncompressed targa format. you can use the batch processing feature of PSP (which is why i suggested it--i assume you already have these jpg's) to convert an entire directory of images in a fell swoop. then you will need the truecolr.e library from chris street, available on the main euphoria page. that library does have a bug or two... the bug that will keep you from doing things however, is rather nasty. below you will find the fixed function in that library that causes a heinous error... just cut/paste back to the library and itll work properly. the library is quite lacking in 'the basics', and i'm one bug away from uploading a new truecolor library, with many, many new features, and truecolor mouse support as well (what's stopping me is the damned mouse cursor keeps wrapping around the right edge of the screen...ARGH!) last note: for some reason you need to 'flip' the targa images along the horizontal axis (top->bottom) before saving them...it'll display the image upside down if you don't...doesn't seem to be a problem with the library code tho...not sure. here is the fixed function: global procedure copy_image (atom a1,atom a2,sequence w1,sequence w2) atom b1,b2 integer nx,ny,wid1,wid2 wid1=get_width(a1) wid2=get_width(a2) b1=a1+8+((w1[1][2]*wid1)+w1[1][1])*bpp b2=a2+8+((w2[2]*wid2)+w2[1])*bpp --this is the bad line --it used to be: --nx=w1[2][1]-w1[1][2]+1 nx=w1[2][1]-w1[1][1]+1 ny=w1[2][2]-w1[1][2]+1 if nx+w2[1]>=wid2 then nx=wid2-w2[1] end if if ny+w2[2]>=get_height(a2) then ny=get_height(a2)-w2[2] end if for e=1 to ny do mem_copy(b2,b1,nx*bpp) b1=b1+(wid1*bpp) b2=b2+(wid2*bpp) end for end procedure