>I did some research on what you were trying to do. According to a thread I
>found at ureader.com. Ken Slovak said that IPictureDisp constraint is that
>the image must be a 16x16 256 color BMP. Other wise you might get the
>error that you are experiencing.
>
> If I were you I would convert your .ico to a .bmp and try to run the
> program again. Or, go ahead and add the image to a resource file inside
> your add-in and use a resource manager to pull the appropriate image out
> of and then use the IPictureDisp code that you already have to render the
> image on the commandbar button.
>
> It's an idea, for what it's worth
>
> Thaddaeus.
>
>
http://support.microsoft.com/kb/288771> "donald" <jonathan[ at ]dorling.biz> wrote in message
> news:1139481239.824084.252610[ at ]g43g2000cwa.googlegroups.com...
>>I try very think in this topic but i still can't get it working. I
>> don;t want to use the copy and paste because the user will loss there
>> clipboard and if you try so save it, it could be 300mb as explain
>> above.
>>
>> So could some one who got it working post there code up. The code i
>> have is:
>>
>> Dim path As String = "C:\Visual Studio
>> Projects\DC\DMCRM\icons\AddTelephoneCall.ico"
>>
>> Dim imgconv As ImageConverter
>> Dim img As System.Drawing.Image
>>
>> img = System.Drawing.Image.FromFile(path)
>> Dim a As stdole.IPictureDisp =
>> imgconv.ImageToIPicDisp(img)
>>
>> .Picture = a
>>
>> Public Class ImageConverter
>> Inherits System.Windows.Forms.AxHost
>>
>> Public Sub New(ByVal pGUID As String)
>> MyBase.New(pGUID)
>> End Sub
>>
>> Public Shared Function ImageToIPicDisp(ByVal value As
>> System.Drawing.Image) As stdole.IPictureDisp
>> Return
>> System.Windows.Forms.AxHost.GetIPictureDispFromPicture(value)
>> End Function
>>
>> Public Shared Function IPicDispToImage(ByVal value As
>> stdole.IPictureDisp) As System.Drawing.Image
>> Return
>> System.Windows.Forms.AxHost.GetPictureFromIPictureDisp(CType(value,
>> Object))
>> End Function
>> End Class
>>
>>
>> the code get a error on this line ' .Picture = a'
>>
>> any help please
>>
>> Donald
>>
>
>