Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Accurate Detection of Graphic Area of Shape Object
Hi all:
REQUEST: I need to accurately detect only the graphic region of shape objects in Excel. There will be several overlapping shapes that I need to accurately discriminate. I am not a professional programmer. PROBLEM: Shapes in general in Excel have a zone around them (roughly 4 pixels wide) that form part of the object. ActiveWindow.RangeFromPoint returns the object even though not directly referencing a point over the graphic region. Freeforms apparently have longer and unpredictable projections from sharp points. CURRENT APPROACH So far all I can come up with is a kludge that uses RangeFromPoint in combination with GetPixel. I conduct a pixel walk between two clicked points captured using PeekMessage. When I detect a new shape I capture its fill forecolor and change it to a reserved forecolor. I then continue the walk and record the start and end points where I detect the reserved forecolor using GetPixel. When I get past the shape I reset the forecolor. The manner in which I sort out overlapping shapes is a complex loop and recursive process. Obviously, if using GetPixel, I cannot turn off screen updating (or use LockWindowUpdate). So, you see the whole thing flash and flicker and it takes a while if there are a lot of shapes. Best regards, Greg |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can I assign a macro to a graphic object on the worksheet | Excel Discussion (Misc queries) | |||
mouse pointer in and out from commandbutton's area detection | Excel Programming | |||
Line Graphic with Area | Charts and Charting in Excel | |||
Saving a Worksheet Shape as a Graphic File ! | Excel Programming | |||
Graphic object as a result of a formula | Excel Programming |