Home »
Public Forums »
archive »
Re: tvrd failure on v5 on win95
Re: tvrd failure on v5 on win95 [message #9104] |
Wed, 04 June 1997 00:00 |
Struan Gray
Messages: 178 Registered: December 1995
|
Senior Member |
|
|
Mirko Vukovic, mirko.vukovic@grc.varian.com writes:
> (some of you may recognize it as part of Struan's
> surface plotting tutorial).
I thought it looked familiar :-)
> _depending_ on the color table loaded with LOADCT (I
> tried 6 and 25), clr_surf contains a severely defficient
> image. Do a tv,clr_surf, and you will get either only the
> axes drawn (for color table 25) or a surface image but with
> colors that do not correspond to the original (for color
> table 6)
It could be a bug in v5.0 but I would guess you are doing this on
a 16-bit or 24-bit display where TVRD doesn't return the colour index
used to plot the image, but instead gives you whichever of the red,
green and blue values for each pixel is largest. With some colour
tables this can give very different results from what you get on an
8-bit display.
The tutorial sort of says this, but I'll see if I can make it more
explicit since re-reading it I realise that it doesn't point out that
the inline code snippet *has* to be adapted to work properly for
24-bit displays. My example code procedures always use TVRD_24 which
explicitly checks for the colour depth of the display every time.
If you really want to get the colour index back from the display
you have to read the rgb colour triple and then step through the
colour map entries looking for a match (or use WHERE). Ugly and slow.
Struan
|
|
|
Current Time: Wed Oct 08 14:32:49 PDT 2025
Total time taken to generate the page: 0.00425 seconds