How to programmatically make a shape transparent

G

Guest

I am attempting to provide some functionality that goes through the shapes
and selectively (based upon a custom property value) make a shape
transparent. Unfortunately I am having some trouble. This is what I have
done...anyone have any idea what I am doing wrong?

I tried to duplicate the Visio Transparency functionality on the Format
Shape toolbar that let's you adjust the transparency level of a selected
shape. When I use the Visio Transparency functionality the following cells
are modified.

RowFill section
Fill Foregound Trans
Fill Shadow Foregnd Trans
Fill Backgnd Trans
Fill Shadow Backgnd Trans

Row Line section
LineColorTrans

Row Text section
TxtBlkBkgndTrans

Row Image section
Image Transparency

So I made my code do the same (see below). My code is working in the sense
that it is setting the identical values that the Visio Transparency
functionality is in the shape sheet but the transparency of the shape does
not change. The Visio Transparency functionality must be doing something
more. Anyone know what else I need to do to duplicate the Visio Transparency
Functionality that Visio has.


My Code
For each shape that I want to make transparent I have change the following
formulas to 100% (the code is in C++ but I think it's pretty self
explanatory.)

strTemp = "100%";

// First set the Fill Foreground transparency
shape.CellsSRC(visSectionObject, visRowFill, visFillForegndTrans, cell);
cell.putFormulaU(VBstr(strTemp));

// Set the Shadow forground transparency
shape.CellsSRC(visSectionObject, visRowFill, visFillShdwForegndTrans, cell);
cell.putFormulaU(VBstr(strTemp));

// Set the Fill background transparency
shape.CellsSRC(visSectionObject, visRowFill, visFillBkgndTrans, cell);
cell.putFormulaU(VBstr(strTemp));

// Set the shadow background transparency
shape.CellsSRC(visSectionObject, visRowFill, visFillShdwBkgndTrans, cell);
cell.putFormulaU(VBstr(strTemp));

// Set the LineColorTrans
shape.CellsSRC(visSectionObject, visRowLine, visLineColorTrans, cell);
cell.putFormulaU(VBstr(strTemp));

// Set the TextBlock Format
shape.CellsSRC(visSectionObject, visRowText, visTxtBlkBkgndTrans, cell);
cell.putFormulaU(VBstr(strTemp));

// Finally set the transparency
shape.CellsSRC(visSectionObject, visRowImage, visImageTransparency, cell);
cell.putFormulaU(VBstr(strTemp));
 

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