1. RGB's..........
- Posted by Patrick Quist <quistnet at HOTMAIL.COM> Mar 10, 1999
- 438 views
Hy, I'm currently using this procedure to display a bitmap in a Win32Lib Window (Don't ask why... It's a long story) But RGB() does not return the right color. I use a normal Bitmap that I read with read_bitmap() from image.e [BOF] include win32lib.ew type graphics_point(sequence p) return length(p) = 2 and p[1] >= 0 and p[2] >= 0 end type global procedure drawImage(integer winid,graphics_point xy,sequence pixels,sequence pal) integer tmp object tmp2 tmp=xy[1] for i = 1 to length(pixels) do for j = 1 to length(pixels[i]) do tmp2=pal[pixels[i][j]] setPixel(winid,xy[1],xy[2],rgb(tmp2[1],tmp2[2],tmp2[3])) xy[1] = xy[1] +1 end for xy[1] = tmp xy[2] = xy[2] + 1 end for end procedure [EOF] In Win32Lib.ew they use the same RGB values as in normal DOS "things". It's not the problem with 'divide_by_4' because that isn't needed with RGB(). Bye, PQ QC Get Your Private, Free Email at http://www.hotmail.com
2. Re: RGB's..........
- Posted by David Cuny <dcuny at LANSET.COM> Mar 10, 1999
- 423 views
Patrick Quist wrote: >I'm currently using this procedure to display a >bitmap in a Win32Lib Window (Don't ask why... It's a long story) >But RGB() does not return the right color. >I use a normal Bitmap that I read with read_bitmap() from image.e Just glanging at it, I wonder it the indexing to the palette is correct. Perhaps the line: > tmp2=pal[pixels[i][j]] should read: > tmp2=pal[pixels[i][j]+1] since the values in pixel are (usually) zero based. It's unlikely that RGB() isn't working - take a look at the code and you'll see why. But then, anything's possible - I'm rather iffy about Win32 graphics, especially working with bitmaps. Hope this helps. -- David Cuny BTW, thanks for the apology.
3. Re: RGB's..........
- Posted by Bernie Ryan <bwryan at PCOM.NET> Mar 10, 1999
- 426 views
Be sure you are in the correct video mode. I have not used RGB in Euphoria but I know in other languages this can cause a problem. If your display is in some video modes ( 8 bit and etc ) you need to use values from 0 to 63 instead of 0 to 255 Sometimes you can divide by 4 to get a good color. rgb(r/4,g/4,b/4) but this does not always work its easier to change your video mode
4. Re: RGB's..........
- Posted by Patrick Quist <quistnet at HOTMAIL.COM> Mar 10, 1999
- 418 views
>From: David Cuny <dcuny at LANSET.COM> >Subject: Re: RGB's.......... > >Just glanging at it, I wonder it the indexing to the palette is correct. >Perhaps the line: > >> tmp2=pal[pixels[i][j]] > >should read: > >> tmp2=pal[pixels[i][j]+1] > THAT'S IT !!!!!!!!!! THANKS!!!!! BTW. Why aren't you updating Dos32Lib ? I'm updating it for myself, I already added my ProgressBar, I changed onLoad to onOpen, I changed unloadWindow to closeWindow I send it when I'm finished... (But you have to finish the List,Combo etc.) Bye, PQ QC Get Your Private, Free Email at http://www.hotmail.com