PDA

View Full Version : DMK51AG02 MemoryGetImagedata --->Empty



pvol1
March 21, 2013, 12:37:55
Hello all,

i have the camera type above. Although i take and save picture with livestart i dont get any
data from the function MemoryGetImagedata for any further calculations also from the property Picture.

my sample code is :

If ICImagingControl.DeviceValid Then
If ICImagingControl.LiveVideoRunning = False Then
ICImagingControl.LiveStart
End If
End If
Set ICImagingControl = Nothing

If ICImagingControl.DeviceValid Then
If ICImagingControl.LiveVideoRunning Then
ICImagingControl.LiveStop
End If
End If
If ICImagingControl.DeviceValid Then
ICImagingControl.MemorySnapImage

ICImagingControl.MemorySaveImageJpeg TargetFile, 90

Picture1.Picture = ICImagingControl.Picture
BildArray() =ICImagingControl.MemoryGetImageData


thanks in advanced..

Stefan Geissler
March 21, 2013, 12:58:15
Hello,

what is saved in the Target file? Does it contain something useful?

pvol1
March 21, 2013, 13:02:23
Hello,

in Targetfile i have the picture from Memorysnapimage,which is the desired picture.

Stefan Geissler
March 21, 2013, 16:16:08
Sorry, I misunderstood your case... VB6 is a little bit outdated, therefore I do not have all of this in my mind.

If you want to access the image data as array, then this works as follows:


Dim ImageData As Variant
Dim x As Integer, y As Integer
ICImagingControl1.MemorySnapImage
ImageData = ICImagingControl1.MemoryGetImageData
For y = 0 To ICImagingControl1.ImageHeight - 1
For x = 0 To ICImagingControl1.ImageWidth - 1
ImageData(x, y) = 255 - ImageData(x, y)
Next x
Next y
ICImagingControl1.MemoryReleaseImageData ImageData
ICImagingControl1.Display


Your "BildArray" is an unknown type for me. However, MemoryGetImageData return a variant. The code above is from the documentation:
http://www.imagingcontrol.com/en_US/support/documentation/activex/meth_descICImagingControl_MemoryGetImageData.htm

pvol1
March 22, 2013, 13:58:41
;-) Thank you very much!!!
i have defined Bildarray as Byte ...When i change it to variant i get error in this line..
However with this example i can make a start.