473,779 Members | 1,909 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 8056
"Metallicor e" <an*******@disc ussions.microso ft.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.FromHbitm ap
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*******@disc ussions.microso ft.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.FromHbitm apmethod 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("3AF F760D-9937-4f65-95B7-258AB7CB4E78")
End Sub

Public Shared Function ImageToIPicture (ByVal Image As _
System.Drawing. Image) As stdole.StdPictu re
ImageToIPicture = AxHost.GetIPict ureFromPicture( Image)
End Function

Public Shared Function IPictureToImage (ByVal Image As
stdole.StdPictu re) _ As System.Drawing. Image
IPictureToImage = AxHost.GetPictu reFromIPicture( Image)
End Function
End Class

"Metallicor e" <an*******@disc ussions.microso ft.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
3396
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 Knowledge base has very little on the STDPicture object. Does anyone know if there is a build-in limitation that prevents you from passing this type of object? If so, is there a work around method I've missed? If anyone could point me toward some...
6
4325
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 column has 10,000 nulls in table A. Select count(*) from table A where col1 is null=10,000 Using the load utlity, I load the data file as follows into table B which has not null constraint on col1: LOAD FROM LOAD.TEST OF ASC MODIFIED BY...
1
2142
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, how can I use C# to express the same idea? I want to know what is "Picture" means in C#, and how can I construct it! --
1
5314
by: Sagaert Johan | last post by:
How can i put the image in a stdole.StdPicture object in a Picturebox.Image ?
2
2025
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 the form as I'd expect after the method had been run. The second time I do this the usercontrol appears on the form as if the usercontrols Load had last been run.
3
7202
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 is full. SQLSTATE=57011" But I felt that Load utility wont log any acvitities on the database. Here it what I tried to do db2 "declare c1 cursor for select CAST(PARTITIONING_NBR AS CHAR(10)), VEH_IDENT_NBR, OPTN_CD, VIN_TYPE_CD,...
4
3216
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; the graphic is supplied as a "StdPicture" (AKA, IPictureDisp). How can I convert this to a .NET Image? A search of the object browser shows: protected static System.Drawing.Image GetPictureFromIPictureDisp(object picture)
1
3825
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 multiple unrecoverable loads. We are tyring to come up with the best backup strategy for this system? It is a large dev data warehouse. What happens when a table is loaded unrecoverable and then we need to restore (no DDL has been done)? Can we...
0
1807
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 convert the IPictureDisp object it creates into an Image for use with .NET: -----begin source (C#)----- //Take page 1 MODI.Image page_1 = (MODI.Image) doc.Images;
0
9633
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10305
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10074
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9928
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6724
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5373
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4037
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3632
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2867
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.