Hi,
I'm trying to move some VB6 data and algorithms dealing with pictures and
images to VB.NET.
Is there a .NET equivalent of these VB6 commands (LoadPicture, SavePicture)?
I think StdPicture is defined in stdole ... so does that mean that VB.NET
can deal with such objects via Interop? I am writing a VB.NET app that has
to use a COM object that returns a StdPicture.
I am trying to see what's available in .NET VB6 compatibility but I can't
seem to add this library as a reference to my VB.NET project.
Thankful for any help ...
Blaise
MarkB - 12 Oct 2005 20:25 GMT
Oh, forgot to ask ... is there a way to convert a StdPicture to a .NET Image
??
thx
Ole Nielsby - 13 Oct 2005 10:54 GMT
> Oh, forgot to ask ... is there a way to convert a StdPicture to a .NET
> Image
This might not be the simplest way, but if all else fails, go via GDI+.
The flat GDI+ API has methods that will turn handle/hpal into GDI+
images - you need to select the method according to the StdPicture type.
I don't know how to go from GDI+ to .NET but I think it is simple
since the .NET graphics are AFAIK based on GDI+.
HTH/ON/remove the slow slimy aniaml from my reply address
Patrick Steele [MVP] - 21 Oct 2005 03:02 GMT
> Hi,
>
[quoted text clipped - 6 lines]
> can deal with such objects via Interop? I am writing a VB.NET app that has
> to use a COM object that returns a StdPicture.
Add a reference to "Microsoft Visual Basic .NET Compatibility Runtime".
Then look at the Microsoft.VisualBasic.Compatibility.VB6.Support class.
It has a few methods that might help you out (i.e. "IPictureToImage" and
"IPictureDispToImage").
If you're just looking to load an image from disk, check out .NET's
System.Drawing.Image.FromFile() method.

Signature
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele