Re: Return a Bitmap as IPicture
- From: "Dave Sexton" <dave@jwa[remove.this]online.com>
- Date: Wed, 12 Jul 2006 13:15:45 -0400
Hi Yoavo,
System.Drawing.Bitmap does not implement the OLE IPicture interface. You'll
have to create your own implementation of that interface to wrap the Bitmap
object.
Actually, just on a hunch I searched for IPicture in the VS.NET 2005 object
browser and I discovered the following method:
System.Windows.Forms.AxHost.GetIPictureFromPicture(System.Drawing.Image)
Take a look at some of the other AxHost methods that deal with IPicture as
well. They may come in handy.
- Dave Sexton
"Yoavo" <yoav@xxxxxxxxxxxxxx> wrote in message
news:O%232vd3cpGHA.1440@xxxxxxxxxxxxxxxxxxxxxxx
Hi,
I am writing a COM class in c# which needs to implement an interface which
one of its methods declared in the following way:
public stdole.IPicture GetBitmap()
{
}
I have a bitmap (MyBitmap.bmp) in my c# application and I want to load it,
and return it as a return value of the method GetBitmap.
I created a System.Drawing.Bitmap object and load it with MyBitmap.bmp
file.
Now, I tried to convert my Bitmap object to stdole.IPicture, but I dont
know how to do it.
Can someone please help (or suggest a different approach) ?
thanks,
Yoav.
.
- Follow-Ups:
- Re: Return a Bitmap as IPicture
- From: Nicholas Paldino [.NET/C# MVP]
- Re: Return a Bitmap as IPicture
- References:
- Return a Bitmap as IPicture
- From: Yoavo
- Return a Bitmap as IPicture
- Prev by Date: DataGridView.SelectedCells order?
- Next by Date: Trying to launch Trillian through C# program
- Previous by thread: Return a Bitmap as IPicture
- Next by thread: Re: Return a Bitmap as IPicture
- Index(es):
Relevant Pages
|