PDA

View Full Version : Picture Property



Unregistered
March 6, 2002, 19:15:30
Somewhere I saw that you will be making a picture property available on the next version.. Is this true, and how long..

I am running XP on a Sony VAIA laptop, all I need to do is snag a frame into a picture control 8 times a second, I have made it sort of work with a ramdisk but!..

Also

I get a lot of 'blue screen' crashes, the screen is only visible for a couple of secs so I dont know what the error is exactly but I can tell it is not always the same (Driver corrupted, Page Fault), it usually bombs when I change the video format not always although sometimes just on it's own, all power saving is disabled. Very random intermittent drive u nuts stuff.

Also, If I run my VB app in the IDE, I occasionally get false errors. 'Expression to complex' or 'Overflow', Odd thing is the error is completely bogus and I can just continue execution everything works ok, These error always occur inside Timer events if thats a clue.

Does any of this sound familiar to anyone out there in Cyber World, I'm sure getting fed up with it..

David.


This message was originally posted by David Carcary in the old IC Imaging Control Support Forum.

Unregistered
March 7, 2002, 16:53:34
I had the same problem with the picture property. It seems there were two choices as the software currently stands. The 1st was to write a bit of C that will do the job for me. The 2nd was to find an activex package that could handle DIBs and VB picture controls. I went for the second option in the end as I also required a few image manipulation routines and a few hundred dollars was far cheaper than the time it would have taken to write these in C.
Of course you can also save the image to disk and load it in the control. However, this is totally impracticle for many applications - I'd imagine you have the same problem requiring 8 frames a sec.


When I asked previously they said that picture box compatinility would be in the next update - when is this guys???? The suspense is killing me.


This message was originally posted by Tony in the old IC Imaging Control Support Forum.

Unregistered
March 12, 2002, 17:06:07
Hello David,

I would like to know a little bit more about your hardware setup because the blue screen problem is probably caused by the driver. Which kind of WDM device are you using?
If you could provide me with demo source code which causes the problem you described It would be easier for us to reproduce it.

In the next version of IC Imaging Control, there will be picture property which enables you to simply copy an image out os IC Imaging Control into a picture box.

Best regards
Johannes
IC Support


This message was originally posted by IC Support in the old IC Imaging Control Support Forum.

Unregistered
March 12, 2002, 17:11:49
Hello Tony,

We expect the next update to available within the next four weeks.

Best regards
Johannes
IC Support


This message was originally posted by IC Support in the old IC Imaging Control Support Forum.

Unregistered
March 13, 2002, 23:07:53
I tried to get this to work, but nothing happens. If anyone has some code that works, I would love to see it.

Thanks
Paul

sub cmd_Click
dim lhBMP as long
lhBMP = IC1.MemoryGetDib
Set pic1.Picture = BitmapToPicture(lhBMP)
end sub

Private Type PictDesc
cbSizeofStruct As Long
picType As Long
hImage As Long
xExt As Long
yExt As Long
End Type
Private Type Guid
Data1 As Long
Data2 As Integer
Data3 As Integer
Data4(0 To 7) As Byte
End Type
Private Declare Function OleCreatePictureIndirect Lib "olepro32.dll" (lpPictDesc As PictDesc, riid As Guid, ByVal fPictureOwnsHandle As Long, ipic As Picture) As Long

Public Function BitmapToPicture(ByVal hBmp As Long) As IPicture

If (hBmp = 0) Then Exit Function

Dim oNewPic As IPicture, tPicConv As PictDesc, IGuid As Guid

' Fill PictDesc structure with necessary parts:
With tPicConv
.cbSizeofStruct = Len(tPicConv)
.picType = vbPicTypeBitmap
.hImage = hBmp
End With

' Fill in IDispatch Interface ID
With IGuid
.Data1 = &H20400
.Data4(0) = &HC0
.Data4(7) = &H46
End With

' Create a picture object:
OleCreatePictureIndirect tPicConv, IGuid, 0, oNewPic

' Return it:
Set BitmapToPicture = oNewPic


End Function


This message was originally posted by Paul Jackson in the old IC Imaging Control Support Forum.

Unregistered
March 14, 2002, 18:47:03
Hello Paul,

The reason why this code can never work is:
"OleCreatePictureIndirect" expects a handle to memory containing a BITMAP structure followed by the image data.
The method "MemoryGetDib" returns a handle to a DIB which is a handle to memory containing a BITMAPINFOHEADER
followed by image data.

Best regards
Johannes
IC Support


This message was originally posted by IC Support in the old IC Imaging Control Support Forum.