Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I assign a macro to a graphic object on the worksheet bigjim Excel Discussion (Misc queries) 1 March 24th 08 03:08 AM
mouse pointer in and out from commandbutton's area detection zz Excel Programming 0 January 5th 07 11:14 PM
Line Graphic with Area Pedro Serra Charts and Charting in Excel 1 June 8th 06 01:38 PM
Saving a Worksheet Shape as a Graphic File ! RAFAAJ2000[_2_] Excel Programming 3 May 21st 05 12:30 AM
Graphic object as a result of a formula JWilliamson Excel Programming 1 April 16th 04 10:30 PM


All times are GMT +1. The time now is 11:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"