mscomctl.Button and Transparencies

S

Scott Eguires

I figured out how to add a new button to the PivotTable Toolbar, however
whenever it displays the image it does not use transparencies. I am not sure
what I may be doing wrong. I have tried it with Ico files, Png FIles, Gif
Files in a variety of formats. I even exported one of the images from the
built in imagelist but when I try to import it back it it exhibits the same
problem as if I had created it from scratch. I wrote a customer converter to
convert from stdole.ipicturedisp to image and back so I can pass the images
in but I cannot seem to overcome this transparency background problem.

Thanks,

Scott Eguires
 
A

Alvin Bruney [MVP]

a little more explanation on your part, cuz i'm not grasping what you are
saying fully.
normally, you add a button and stick a bitmap image on top of the button
 
S

Scott Eguires

I get that far. The problem is - Icons in general have transparencies so
when you change the desktop colors you see only the picture and not the area
surrounding the picture. When I assign an image to the button I need the
surrounding areas to be transparent. I have tried everything I can think of
to make my images "compatible" with the built in images but when I change the
background on the desktop to a different color only the built in images seem
to change with it.

Dim iml As mscomctl.ImageList = AxPivotTable1.Toolbar.ImageList
Dim img As mscomctl.ListImage = iml.ListImages.Add(,
"owcMyCustomButton",
clsImageConvert.ImageToIPicture(imlCustomButtons.Images.Item(0)))
Dim b As mscomctl.Button = CB.Add(14)
b.Visible = True
b.Key = "Test"
b.Image = "owcMyCustomButton"
b.ToolTipText = "MyTest"
b.Style = mscomctl.ButtonStyleConstants.tbrDefault

Alvin Bruney said:
a little more explanation on your part, cuz i'm not grasping what you are
saying fully.
normally, you add a button and stick a bitmap image on top of the button

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Scott Eguires said:
I figured out how to add a new button to the PivotTable Toolbar, however
whenever it displays the image it does not use transparencies. I am not
sure
what I may be doing wrong. I have tried it with Ico files, Png FIles,
Gif
Files in a variety of formats. I even exported one of the images from the
built in imagelist but when I try to import it back it it exhibits the
same
problem as if I had created it from scratch. I wrote a customer converter
to
convert from stdole.ipicturedisp to image and back so I can pass the
images
in but I cannot seem to overcome this transparency background problem.

Thanks,

Scott Eguires
 
A

Alvin Bruney [MVP]

you would probably get more help with that question in the graphics
newsgroup.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Scott Eguires said:
I get that far. The problem is - Icons in general have transparencies so
when you change the desktop colors you see only the picture and not the
area
surrounding the picture. When I assign an image to the button I need the
surrounding areas to be transparent. I have tried everything I can think
of
to make my images "compatible" with the built in images but when I change
the
background on the desktop to a different color only the built in images
seem
to change with it.

Dim iml As mscomctl.ImageList = AxPivotTable1.Toolbar.ImageList
Dim img As mscomctl.ListImage = iml.ListImages.Add(,
"owcMyCustomButton",
clsImageConvert.ImageToIPicture(imlCustomButtons.Images.Item(0)))
Dim b As mscomctl.Button = CB.Add(14)
b.Visible = True
b.Key = "Test"
b.Image = "owcMyCustomButton"
b.ToolTipText = "MyTest"
b.Style = mscomctl.ButtonStyleConstants.tbrDefault

Alvin Bruney said:
a little more explanation on your part, cuz i'm not grasping what you are
saying fully.
normally, you add a button and stick a bitmap image on top of the button

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
message
I figured out how to add a new button to the PivotTable Toolbar, however
whenever it displays the image it does not use transparencies. I am
not
sure
what I may be doing wrong. I have tried it with Ico files, Png FIles,
Gif
Files in a variety of formats. I even exported one of the images from
the
built in imagelist but when I try to import it back it it exhibits the
same
problem as if I had created it from scratch. I wrote a customer
converter
to
convert from stdole.ipicturedisp to image and back so I can pass the
images
in but I cannot seem to overcome this transparency background problem.

Thanks,

Scott Eguires
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top