Technology Questions

Go Back   Technology Questions > Hardware Questions > Mobile Computers > Tablet PC > Tablet PC Software > Tablet PC Developers

Tablet PC Developers Show off your work while discussing with others how to create ink enabled applications.

Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old 05-06-2007, 07:31 AM
rahul
Newsgroup Contributor
 
Posts: n/a
Issues with 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.

I am retrieving coordinates within which ink lies, using
GetBoundingBox Method.
Now I check whether Left or Top values of rectangle are negative. (As
strokes crossing Right and Bottom boundary are automatically
clipped )

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.

Q1: 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.

Q2: Is there any other approach?

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

Your help is much appreciated. Thank you in advance.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

 
Old 05-06-2007, 07:31 AM
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
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
clip board always opens with a printer icon saved to the clip boar Fred Microsoft Office 3 12-16-2007 04:41 AM
clip art is gone judithbear Microsoft Office 1 10-04-2007 04:00 PM
MSXML 4 error: This method cannot be called after the send method. Phil_M Windows XP 0 08-10-2007 08:40 AM
Issues with setting a rectangle and clip method kret Tablet PC Developers 1 05-06-2007 07:31 AM
Clip Art help LMO Windows XP 8 01-04-2007 05:31 AM


New To Technology Questions? Do You Need Help with Your Computer or Device? Do You Need Help with this site?

All times are GMT -8. The time now is 06:51 PM.


2003 - 2009 All Rights Reserved. Technology Questions

Search Engine Friendly URLs by vBSEO 3.3.0