Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

16bit to 8bit image conversion vb

I am trying to save an image as a jpeg.  To do this I need to make the image 8bit.  This is one line in the sub to convert the image.  I get a "Runtime error 5.   Invalid Index"  How can I overcome this.  Is there a better way to do it?
 
CWIMAQVision1.Subtract Image, HistogramReport.Item(0).PixelRange.Min, Image
0 Kudos
Message 1 of 6
(4,255 Views)
Although not Visual Basic (although there are references to it), I posted a similar question earlier. See the thread on "C and LUT", http://forums.ni.com/ni/board/message?board.id=200&message.id=8720

Message Edited by Harold Bien on 02-01-2006 02:03 PM

--
[System info: NI-1429e running in 'Base' CL-mode plugged into an x4 PCI-e slot on a Dell PowerEdge 1800, dual 3.2Ghz Xenon, 6GB RAM, Windows 2003 Server SP1, LV8.0/7.1, IMAQ v3.5, Dell CERC SATA RAID controller card with 4x250GB Seagate HDD, one Seagate 250GB HDD connected to system's primary SATA port for OS.]
0 Kudos
Message 2 of 6
(4,234 Views)
Whoops, sorry, dunno how to delete that above msg. Ignore it - it's not really relevant...
--
[System info: NI-1429e running in 'Base' CL-mode plugged into an x4 PCI-e slot on a Dell PowerEdge 1800, dual 3.2Ghz Xenon, 6GB RAM, Windows 2003 Server SP1, LV8.0/7.1, IMAQ v3.5, Dell CERC SATA RAID controller card with 4x250GB Seagate HDD, one Seagate 250GB HDD connected to system's primary SATA port for OS.]
0 Kudos
Message 3 of 6
(4,212 Views)

tres0422,

Was this problem fixed by the solution in your other thread?

Regards,

Ryan F.

0 Kudos
Message 4 of 6
(3,883 Views)

Ryan,

   Yes sir and thanks for following up on this thread.  Should I post the code for future users?  I will admit I am an amature so my code is not the  most efficient but it got the job done this time.  Thanks again for your help.

Thanks,

     Thomas

0 Kudos
Message 5 of 6
(3,878 Views)

No problem.  The code is probably unnecessary in this thread.  For my edification however,  I would be interested if you would post the final working code in the other thread.

Thanks,

Ryan F.

0 Kudos
Message 6 of 6
(3,871 Views)