sapbucket
November 26, 2004, 08:20:44
Hello,
The ICImagingControl.MemoryGetImageData Method returns a "SAFEARRAY of Byte in a Variant". Furthermore, a VB6 example demonstrates how to get/set data:
Private Sub cmdStart_Click()
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
End Sub
I am not terribly familiar with VB, but the line ImageData(x,y) seems weird to me. VB6 must have great built-in support for the VARIANT type?
Anyway, my question is how can I get/set image data (just like in the example above) but using C++? or C? or even PERL?
Can someone show me an example (rewrite the above example) using C++ or PERL?
The ICImagingControl.MemoryGetImageData Method returns a "SAFEARRAY of Byte in a Variant". Furthermore, a VB6 example demonstrates how to get/set data:
Private Sub cmdStart_Click()
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
End Sub
I am not terribly familiar with VB, but the line ImageData(x,y) seems weird to me. VB6 must have great built-in support for the VARIANT type?
Anyway, my question is how can I get/set image data (just like in the example above) but using C++? or C? or even PERL?
Can someone show me an example (rewrite the above example) using C++ or PERL?