LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Open picture

Hi,

I want to draw an XY-graph on a picture, this works fine i've made my XY
graph trancperant and put it on the foregroynd of my picture controle. The
pictures i have are grayscale, so they are 8-bit, but when i want to see 'm
i have to convert 'm to 24-bit otherwise i get very strange colors if i use
"draw 8-bit pixmap". Now when i use the 24 bit pixmap my whole application
slows down, because of the enormous calculations (i think), isn't there
anyway to read a gray scale pixmap or to increase the speed?

Best regards,
Thijs
0 Kudos
Message 1 of 2
(2,437 Views)
> I want to draw an XY-graph on a picture, this works fine i've made my XY
> graph trancperant and put it on the foregroynd of my picture controle. The
> pictures i have are grayscale, so they are 8-bit, but when i want to see 'm
> i have to convert 'm to 24-bit otherwise i get very strange colors if i use
> "draw 8-bit pixmap". Now when i use the 24 bit pixmap my whole application
> slows down, because of the enormous calculations (i think), isn't there
> anyway to read a gray scale pixmap or to increase the speed?
>


When you draw an 8 bit image, there is an optional parameter for the
color table. If not wired, it defaults to the LV color table, which is
pretty much like the HTML one, very colorful covering the entire
spectrum. You will want to wire up
the color values for those 256 pixel
encodings that are in your bitmap, otherwise LV has no way to interpret
them except to use our colorful lookup table. The easiest way to make
your grayscale color table is to look from 0 to 255 making an array of
numbers that are (((i*255)+i)*255)+i. If the image looks like a
photo-negative, then reverse the array or use 255-i in the above
expression where you see i.

Another way to speed this up is to use the panel property to Defer Panel
Updates. Since you have multiple controls, there are times when your
display is correct, and probably other times when it is in transition --
one control is updated, but not the other, or attributes not set. You
can avoid drawing the intermediate steps by turning on deferred updates,
setting the various values and properties, then turning the updates back
on by setting deferring to FALSE. The property is obtained by getting
the panel reference from a VI property node, wiring that to another
prop
erty node, and selecting Defer Updates.

Greg McKaskle
0 Kudos
Message 2 of 2
(2,437 Views)