Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB 6.0 >>> VB.NET / October 2005

Tip: Looking for answers? Try searching our database.

LoadPicture, SavePicture, StdPicture support in VB .NET ??

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
MarkB - 12 Oct 2005 19:59 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.