473,405 Members | 2,294 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Load vb6 stdPicture from vb.net

Does anyone know how to load a vb6 stdPicture (in an
existing DLL) from vb.net?

System.Drawing.Image is not the same thing as stdPicture
in vb6.
Nov 20 '05 #1
3 8018
"Metallicore" <an*******@discussions.microsoft.com> wrote in message
Does anyone know how to load a vb6 stdPicture (in an
existing DLL) from vb.net?
System.Drawing.Image is not the same thing as stdPicture
in vb6.


If I remember correctly, the StdPicture object has a 'Handle' property [that
returned a Long in VB classic].
You can pass that value as the hBitmap parameter of the Image.FromHbitmap
method and it will return a .NET Bitmap instance.

If the StdPicture also has a Palette property [I seem to remember something
like that, but I'm unsure], you can use the second overload of the
FromHbitmap method to pass that palette handle also.

Regards,
Pieter Philippaerts
Managed SSL/TLS: http://www.mentalis.org/go.php?sl
Nov 20 '05 #2
If I understand you correctly, I'd have to change the vb6
dll, I cannot. It has a property that accepts a
StdPicture. I want to send it a bitmap from a VB.Net app.
-----Original Message-----
"Metallicore" <an*******@discussions.microsoft.com> wrote in message
Does anyone know how to load a vb6 stdPicture (in an
existing DLL) from vb.net?
System.Drawing.Image is not the same thing as stdPicture in vb6.


If I remember correctly, the StdPicture object has

a 'Handle' property [thatreturned a Long in VB classic].
You can pass that value as the hBitmap parameter of the Image.FromHbitmapmethod and it will return a .NET Bitmap instance.

If the StdPicture also has a Palette property [I seem to remember somethinglike that, but I'm unsure], you can use the second overload of theFromHbitmap method to pass that palette handle also.

Regards,
Pieter Philippaerts
Managed SSL/TLS: http://www.mentalis.org/go.php?sl
.

Nov 20 '05 #3
Public Class ImageConverter
Inherits System.Windows.Forms.AxHost
' converts a IPicture to .Net image format

Public Sub New()
MyBase.New("3AFF760D-9937-4f65-95B7-258AB7CB4E78")
End Sub

Public Shared Function ImageToIPicture(ByVal Image As _
System.Drawing.Image) As stdole.StdPicture
ImageToIPicture = AxHost.GetIPictureFromPicture(Image)
End Function

Public Shared Function IPictureToImage(ByVal Image As
stdole.StdPicture) _ As System.Drawing.Image
IPictureToImage = AxHost.GetPictureFromIPicture(Image)
End Function
End Class

"Metallicore" <an*******@discussions.microsoft.com> wrote in message news:<0a****************************@phx.gbl>...
Does anyone know how to load a vb6 stdPicture (in an
existing DLL) from vb.net?

System.Drawing.Image is not the same thing as stdPicture
in vb6.

Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Bruce A. Wilkinson | last post by:
Greetings All I am currently attempting to pass an STDPicture object to the Picture property of a class module within a DLL. However, none of the usual methods seem to apply. The Microsoft...
6
by: JS | last post by:
EE instance DB2 v7.2.0 fixpack 3 on WIN2K. I select some data from a table A and write it to a file using the COALESCE function and whitespace as the null character: eg coalesce(col1, ' '). This...
1
by: bin liu via DotNetMonster.com | last post by:
I want to create a object of stdPicture in C#, so that I can render it to other object's prosperity. the VB6 code maybe as follow: Dim pic as Picture; pic = LoadPictureFile(strPath); then,...
1
by: Sagaert Johan | last post by:
How can i put the image in a stdole.StdPicture object in a Picturebox.Image ?
2
by: **Developer** | last post by:
I have a Form (FV&C) containing a userconrtrol (CF&E) I do a ShowDialog for the form and the form's Load calls a method of the UserControl. The first time I do this the usercontrol appears on...
3
by: db2udbgirl | last post by:
Env: DB2 UDB 8.2, AIX 5.3 While trying to load data (73 Million rows, Medium size table uses 4K tablespace) into a table using cursor it fails with "SQL0964C The transaction log for the database...
4
by: Mark | last post by:
We're authoring a VS 2005 app that includes several EXE's and DLL's and also uses a COM component (a customer requirement). The COM component provides a graphic image to be used by the .NET app;...
1
by: dbagirltx | last post by:
We have done some testing with mixed and forgotten results. So I'm hoping that asking here can clarify some issues for us. Right now we do one weekly warm backup. Throughout the week there are...
0
by: fyderniX | last post by:
Hey; I'm using the Document Imagine API from Office 2003. I need to get away from the proprietary MDI/TIFF formats it produces. It looked pretty simple, but it's giving me grief when I try to...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.