IntPtr and bitmap error using Twain

Has anyone found an anwser to this problem? I am getting the same error. Please Help!

Thank you

--
Hi,

I have a System.IntPtr to an image that has been obtained from a Twain Datasource. I wish to take this and create a bitmap image that I can then put into a picturebox, the code I have used is;

dim img as image
img = Image.FromHbitmap(Pics(0)) 'where pics is an arraylist of System.IntPtr that is returned from the twain DS.

When this runs I get the following exception;

An unhandled exception of type 'System.Runtime.InteropServices.ExternalException' occurred in system.drawing.dll
Additional information: A generic error occurred in GDI+.

Not having too much experience in GDI+ can anyone see what I'm doing wrong?

TIA

Terry.

[778 byte] By [ETSUGeek] at [2007-12-17]