Discussion:
IPictureDisp in C#
(too old to reply)
john
2003-10-01 21:56:34 UTC
Permalink
I'm working on an add-in and one of the methods in the
extensibility model takes an object of type IPictureDisp.
How can i get this in .Net? I've tried loading up bitmap,
image and icon classes, and use those, but they dont
impelemt this interface.

has any one played with IPictureDisp in C#?
thanks,
John
.
Bob Powell [MVP]
2003-10-02 08:20:50 UTC
Permalink
You can create an object that contans an image and which implements
IPictureDisp. You may wish to have it implement IPicture also.

COM interop will enable this object to be used by the method.

This article http://www.codeproject.com/csharp/advhost.asp?target=tlbimp
shows how to create a type library and interop assembly for an interface. In
this article it's IPersistStreamInit but you can use IDL something like this
(below) to import the interface you need...

[

uuid(6D9B409B-C363-4636-A70F-626A4227D88E)

]

library IPictureDispInterop

{

import "ocidl.idl";

interface IPictureDisp;

};

Once you have the interop assembly built, you can add it as a reference in
your project, create a class that implements IPictureDisp and that also
contains an image and then have the methods declared by IPictureDisp return
the needed information.

Hope this sets you on the right track.


--
Bob Powell [MVP]
C#, System.Drawing

September's edition of Well Formed is now available.
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm
Post by john
I'm working on an add-in and one of the methods in the
extensibility model takes an object of type IPictureDisp.
How can i get this in .Net? I've tried loading up bitmap,
image and icon classes, and use those, but they dont
impelemt this interface.
has any one played with IPictureDisp in C#?
thanks,
John
.
Continue reading on narkive:
Loading...