|
| | |||||||
| Tablet PC Developers Show off your work while discussing with others how to create ink enabled applications. |
| | LinkBack | Thread Tools |
| |||
| Issues with setting a rectangle and clip method Hi, I am using InkOverlay object placed on picture control. Its an activeX control using VB6 I need to do a simple task of deleting part of stroke, that crosses boundary of control. Q1 : I observe that strokes which are crossing "right" and "bottom" boundaries are get clipped automatically. Can you give me document or link to document which says its a by default behaviour? Or can I get explaination for it? Now to delete part of stroke which crosses left, top boundary, I am using Clip method of InkDisp object. Problem is with setting a rectangle before passing it to Clip method. I am using scrollbar on picture control or panel Due to this, If I use Picture control's Top, Left, Right, Bottom properties for setting rectangle, It is giving undesirable results. So I am retrieving coordinates within which ink lies, using GetBoundingBox Method. Now I check whether Left or Top values of rectangle are negative.(As I concerns only with Left and Top boundary) If it is so I set rectangle with Left and Top values as zero and Bottom and Right values with the values retrieved using GetBoundingBox method. And here I called Clip method. This works fine sometimes, but otherwise ink is get placed at wrong position. Now, suppose I called GetBoundingBox method again, I found Left and Top values are again negative say -50, -50 Actually I am expecting it to be zero, as we have set it to zero in rectangle that passed to Clip Method. Q2: Can you tell me why it is happening ? Now if I set Rectangle as 50, 50, Right + 50, Bottom + 50 and then call clip method It works absolutely fine. Q3: Is there any other approach? Q4: Also let me know calling Clip method for each stroke on stroke event is better or Should I call it at the time of saving annotation? Note: I am calling GetBoundingBox method with default parameter here is code --- ' Get bounding rectangle Set boundingRect = stroke.GetBoundingBox boundingRect.GetRectangle inkTop, inkLeft, inkBottom, inkRight ' Check if stroke crosses Left Top boundaries If (inkTop < 0) Or (inkLeft < 0) Then ' Convert bottom and Right values to Ink Space coordinates Overlay.Renderer.PixelToInkSpace pic.hDC, inkBottom, inkRight ' Call Set rectangle 'Rect.SetRectangle 50, 50, inkBottom + 50, inkRight + 50 ' Call Clip method stroke.Clip Rect End If Thank you in advance. |
| |||
| Re: Issues with setting a rectangle and clip method On Mar 7, 5:46 pm, "kret" <rahulnparad...******.com> wrote: > Hi, I am using InkOverlay object placed on picture control. Its an > activeX control using VB6 > I need to do a simple task of deleting part of stroke, that crosses > boundary of control. > > Q1 : I observe that strokes which are crossing "right" and "bottom" > boundaries are get clipped automatically. Can you give me document or > link to document which says its a by default behaviour? Or can I get > explaination for it? > > Now to delete part of stroke which crosses left, top boundary, I am > usingClipmethod of InkDisp object. > > Problem is with setting a rectangle before passing it toClipmethod. > I am using scrollbar on picture control or panel > Due to this, If I use Picture control's Top, Left, Right, Bottom > properties for setting rectangle, It is giving undesirable results. > > So I am retrieving coordinates within which ink lies, using > GetBoundingBox Method. > Now I check whether Left or Top values of rectangle are negative.(As I > concerns only with Left and Top boundary) If it is so I set rectangle > with Left and Top values as zero and Bottom and Right values with the > values retrieved using GetBoundingBox method. > And here I calledClipmethod. > This works fine sometimes, but otherwise ink is get placed at wrong > position. > Now, suppose I called GetBoundingBox method again, I found Left and > Top values are again negative say -50, -50 > Actually I am expecting it to be zero, as we have set it to zero in > rectangle that passed toClipMethod. > Q2: Can you tell me why it is happening ? > > Now if I set Rectangle as 50, 50, Right + 50, Bottom + 50 and then > callclipmethod > It works absolutely fine. > > Q3: Is there any other approach? > > Q4: Also let me know callingClipmethod for each stroke on stroke > event is better or Should I call it at the time of saving annotation? > > Note: I am calling GetBoundingBox method with default parameter > here is code --- > > ' Get bounding rectangle > Set boundingRect = stroke.GetBoundingBox > boundingRect.GetRectangle inkTop, inkLeft, inkBottom, inkRight > > ' Check if stroke crosses Left Top boundaries > If (inkTop < 0) Or (inkLeft < 0) Then > ' Convert bottom and Right values to Ink Space coordinates > Overlay.Renderer.PixelToInkSpace pic.hDC, inkBottom, inkRight > ' Call Set rectangle > 'Rect.SetRectangle 50, 50, inkBottom + 50, inkRight + 50 > ' CallClipmethod > stroke.ClipRect > End If > > Thank you in advance. Hi All, Any thoughts on above issues. I need them urgently. Your help is much appreciated. Thanks and Regards, kret |
| Bookmarks |
| Thread Tools | |
| |
| | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| blue rectangle on desktop | cdbr | Internet Explorer | 5 | 12-31-2007 08:50 PM |
| clip board always opens with a printer icon saved to the clip boar | Fred | Microsoft Office | 3 | 12-16-2007 04:41 AM |
| Green Rectangle | alphachapmtl | Windows Media | 4 | 12-14-2007 02:40 PM |
| Issues with Clip method | rahul | Tablet PC Developers | 0 | 05-06-2007 07:31 AM |
| Setting an environment variable via GPO or other method? (Depends on OS type, 64 or 32bit) ? | markm75 | Windows XP | 5 | 02-01-2007 12:32 PM |
| New To Technology Questions? | Do You Need Help with Your Computer or Device? | Do You Need Help with this site? |