This is nowhere near as easy as it seems because computers are very bad at
correctly making judgment calls. What you can look at and see in a glance
is a complicated problem to the computer.
1) First you have to figure out if you mean the actual background or the
apparent background. A full slide picture that is behind everything looks
like a background but is definitely not what PowerPoint considers the
background to be. There are a half dozen ways that a picture can look like
a background and not be one.
2) How close of a match can it be? If the background color is Blue (RGB
value of 0,0,255) is "near blue" (RGB value of 0,1,255)close enough? In
your code comparison, is completely transparent fill the same as background
fill that is not transparent? How about 99% transparent fill?
3) Figuring out the actual colors of a shape that has been placed over a
gradient will be a bit tricky. At the point where the shape is, what are
the underlying gradient colors (they change with the shape placement)?
4) An alternative method may be to programmatically export the slide as a
JPG, then change the shape in question to "background fill" and re-export.
Then compare the two picture fills bit by bit and see if they are the same.
This will run into problems with the 1st and 2nd points but may solve the
third one.
5) What about partially obscuring shapes behind the shape you are looking
at? Shape A (the one you are testing) sits on top of Shape B. A covered
half of B, but more importunately B is under half of A. Does the blocking
effect of B on the background cause a problem?
--
Bill Dilworth
A proud member of the Microsoft PPT MVP Team
Users helping fellow users.
http://billdilworth.mvps.org
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
vestprog2@ Please read the PowerPoint FAQ pages.
yahoo. They answer most of our questions.
com
www.pptfaq.com
..