Atalasoft
Welcome to Atalasoft Community Sign in | Join | Help
in

Changing the behavior of rotation and resize

Last post 31 Mar 2008, 10:19 AM by tyip. 5 replies.
Sort Posts: Previous Next
  •  21 Mar 2008, 9:43 PM 13526

    Changing the behavior of rotation and resize

    I am currently evaluating DotAnnotate 6.0 via the "Annotation Demo" and had a couple of questions:

     1.  To resize an object such as an embedded image, you grab a grip and move it.  One corner is anchored while the other corners move to new size positions.  Can you change the behavior so that resizing is done from the center?  In other words, the center point is anchored while all corners are moved simultaneously?

     2.  I noticed that when resizing an object like in the previous scenario, a seemingly random corner is picked as the anchored corner.  How is the anchor corner determined, and is it configurable?

     3.  To rotate an object, you grab the green dot and move it.  Can I eliminate the green dot and grab a corner or edge grip instead to do rotations?  Can I define my own hotspot that is used as the grip for rotations?
     

    Filed under: ,
  •  22 Mar 2008, 6:20 AM 13528 in reply to 13526

    Re: Changing the behavior of rotation and resize

    1. There is no option for this but it would be a nice feature.  I'll add it to our feature request list.

    2. It's not random.  When you grab a corner grip it will use the opposite corner as the anchor.  When you grab a side grip it will anchor the opposite side. 

    3. This can be done and there is commented out code in the Annotation Demo source showing how to do it.  In the Form1 source, look for menuAddRectangle_Click and uncomment the two lines that modify the grip.  The first line "rc.Grips[8].Visible = false;" hides the default rotation grip and the second line "rc.Grips[2].Action = AnnotationGripAction.Rotating;" changes the behavior of the top-left grip so you can rotate with it.

    As for adding a hotspot grip, you would have to create your own grips object that implements IAnnotationGrips (or possibly derive from our RectangleGrips class) and create your own grip renderer class that implements IAnnotationGripRenderer.  You could then replace the annotation Grips property and GripRenderer used by the annotation rendering engines.  At this time there are no examples of doing this.


    Glenn Chittenden Jr.
    Atalasoft Development Team
  •  26 Mar 2008, 8:17 AM 13552 in reply to 13528

    Re: Changing the behavior of rotation and resize

    Thanks for the quick response.  Let me play with the demo some more and I'll get back to you if I have further questions.
  •  27 Mar 2008, 1:46 PM 13559 in reply to 13552

    Re: Changing the behavior of rotation and resize

    OK... follow-up questions:

     I have a requirement to convert a PDF file containing vector shapes into a .NET Region.  Can I use DotAnnotate to do this?  Is that what the PDFAnnotationImporter class is for?  If so, could you outline the steps in this process?  For example, I have a PDF containing a circle.  I would like to read the file in and generate a .NET Region describing the circle.

     Do I have to purchase PDF Rasterizer to use the PDFAnnotationImporter class or to access PDF functions in DotAnnotate?

    Thanks in advance.


     

  •  28 Mar 2008, 12:08 PM 13565 in reply to 13559

    Re: Changing the behavior of rotation and resize

    If the PDF "vector shapes" you're talking about are PDF annotations, then DotAnnotate can extract those annotations.  An easy way to find out is to run our compiled annotation demo and load one of those PDF files to see if they appear as annotations.

    You will need PdfRasterizer (PDF Reader) if you want to view the PDF file.  If you are only extracting the annotations from a PDF you do not need PDF Reader.

    You can extract the annotations like this:

    using (FileStream fs = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read))
    {
        PdfAnnotationImporter pdf = new PdfAnnotationImporter(fs);
        LayerCollection lc = pdf.Import();
        ... do whatever you want with the annotations ...
    }


    Glenn Chittenden Jr.
    Atalasoft Development Team
  •  31 Mar 2008, 10:19 AM 13575 in reply to 13565

    Re: Changing the behavior of rotation and resize

    Thanks again.  Let me give that a try and get back to you.

     

View as RSS news feed in XML