Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Ink Control Capabilities

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Ink Control Capabilities

    Does anyone know or can someone from the Alpha Development team comment on the following:

    1. My guess is the ink that is displayed is SVG and not canvas. I am interested in capturing the actual svg data using the onChange event. Is there a variable I can currently access with the svg data or does Alpha plan on releasing a method to access this data?
    2. Once I grab the svg data, I plan on manipulating it using javascript and would like to post back to the editor or the view with the changes. Does Alpha have or plan on releasing a method to achieve this?
    3. Is it possible or does Alpha plan on providing the ability to generate the background of the editor or page via javascript?


    Sample Usage
    • User draws a circle, line, triangle, or whatever.
    • SVG data is retrieved and manipulated to return a perfect geometrical circle, line, or triangle.
    • User draws a line up, lifts pen, draws another line to the left.
    • SVG data is retrieved and manipulated to return a joined line at a right angle or closest angle + or - 5 degrees.
    • User draws a single line up and curved to the left.
    • SVG data is retrieved and manipulated to return a right angle with a perfect geometrical curve or closest angle + or - 5 degrees.
    Thanks,
    James

    #2
    Re: Ink Control Capabilities

    James,

    You have expressed my thoughts exactly, snapping to grid when within x number of pixels, to make a straight line, to line up with the background graph, like I use in iPocketDraw and other apps on my iPad, to import as an image...It would be handy to have all of this available right there in my app, without having to use 3rd party apps to make my drawing (foundation sketch) on my termite report (required in California Wood Destroying Organisms). I really hope this is in the plan too. I did some of this type of programming years ago in Visual Basic and came up with a program I run from my desktop when using MS Word and VBA to generate termite reports...but to have all of the features I need available on my iPad is the goal.

    Ken

    Comment


      #3
      Re: Ink Control Capabilities

      Ink is not SVG - it is a terse format that allows the storing of large numbers of points in a compact way. This allows us to capture handwriting at high fidelity, and make the ink behave well with two important features - erase and undo. Ink can be thought of as a little bit of a mix between raster and vector - in that it captures a lot of points (pretty much one per every one or two pixels) like raster, but stores them as vectors. There are some (currently unexposed) features in the Ink control that will allow you to draw uniform lines, arrows, etc. - but these are still experimental. The issues above have been thought about a little here at Alpha, and the solutions we are looking at are these:

      - add a line tool to Ink: this would allow the user to quickly draw uniform ink lines and could include point and angle snapping, however, the line would be made up of many points (allowing it to be partially erasable like freehand Ink - so it would behave in the same way and not confuse the user).
      - add the ability to have SVG stencils: basically allow for a transformable SVG path to be used as a guide for drawing (like a stencil in real drawing - it would snap Ink points to nearest point on SVG stencil) - basic forms like line, arc, ellipse, and rectangle could be allowed, and custom paths like a french curve could be added as well. Handles would make them quick to move, scale and rotate.

      But there is another aspect to this issue - format. Ink was created to be very good at handwriting. It is not the best format for CAD. To that end, we have been thinking (nothing developed yet) about the ability to have a CAD like format and editor that could produce highly accurate vectors with fewer points - something that could even be exported to a CAD format like DXF and be usable right from loading in a CAD program. However, we'd have to look at the user benefits of spending time on this new control and format (how many users actually need a CAD level of detail - as opposed to the large number that might be fine with an Ink "sketch" - something that would be close to useless in a CAD program).

      Because of the way the Ink control is built adjusting a stroke after it has already been made (besides erasing) is currently troublesome. However, it would be relatively easy to add a mode in which we scribble a placeholder stroke to the Ink while the user is drawing it, and then pass the collected points to a custom function to handle the generation of the desired Ink stroke after the fact... however, the line tool and stencil features might remove the necessity.

      On the generated background question - we support grid and lined "paper" - and have a currently unexposed signature line background - all of these are written through an internal Ink api so a custom background could be done. What is the background you want? If it is more image then vector we do support custom image backgrounds.

      It would be nice to know what specific use cases for ink beyond handwriting/sketching you are thinking of.

      Eavan Chambliss
      Last edited by Eavan Chambliss; 12-19-2015, 04:52 PM.

      Comment


        #4
        Re: Ink Control Capabilities

        Eavan, thanks for your response. When I first tried out the ink control all sorts of ideas popped into my head besides it's intended purpose. For it's intended purpose, as is, I will probably never use. Below are a couple of cases I could think of for sketching:
        1. Reviewing someone else's drawing/mock-up in SVG or whatever graphical format they export it as from the authoring application. The graphic would be dynamically populated in the background (why SVG would work best) and then the user could approve or mark-up the graphic (foreground) were changes should be made. The original graphic plus the markup could then be merged and either saved or emailed to author.
        2. As a general stencil/diagram control for creating documents like an organization chart where the shapes are simple and uniform.
        3. As a general stencil/diagram control for creating documents like a football, soccer, or basketball play. Being able to manipulate the drawing programmatically would be key to producing professional results since you could ensure the shapes conformed to specific rule set.
        4. As a tool that teaches children to write letters or words were the letter/word is programmatically drawn for the child and the child uses the control to trace the letter/word. Data out would determine if the child successfully traced the letter/word.


        Anyway those are my thoughts. The most important aspect to me would be to retrieve the drawing data no matter what form it is in so the points can be manipulated, converted, analyzed, or utilized in some other manner. FYI, every graphic I use in my web applications are SVG unless there is a good reason not to.
        Thanks,
        James

        Comment


          #5
          Re: Ink Control Capabilities

          James,

          Thanks for the input. For 1 and 4 I think that should be able to be done with Ink with a SVG background (which should currently work). For 1 you can convert the Ink into SVG to overlay the document that has been marked up. For 4 the ink point data could be inspected directly to get the strokes. For 2 and 3 the question becomes if Ink wants to be used at all, or whether something more CAD like would be useful. Ink could be made to include "stamps" - paths that get stamped down at a given location and then get turned into many point strokes - this would allow for freehand drawing to be done around these stamps. The other option would be a CAD like format where the diagram parts (shapes in a flow chart for example) are nothing more then a location, scale, rotation and assorted symbol data (like draw a diamond with a circle inside it at that location). If you don't need the freehand, this would be the better solution, as the data could be both terse and more accurate (Ink is integer based so you can't have a decimal ink location) - also the option for real world coors.

          Eavan

          Comment


            #6
            Re: Ink Control Capabilities

            I'm trying to determine if an INK is empty or has been signed.
            Then I can lock down some values that can no longer be modified without erasing the signature.

            A getValue on the control does not return characters, nor can I determine its length or size.
            How best to determine if the control is occupied?
            Ink_Signature is Control Type INK and a type of Character.

            These return a zero length string and a len of zero.
            Think: signatureIsEmpty for Ink.

            var ink = {dialog.Object}.getValue('Ink_Signature');
            var len = ink.length;

            alert('Ink:' + len + ' ('+ink+')');

            ================ Revised ========================

            AutoCommit Checked.

            Now I get a few hundred characters when empty, but a lot more when signed. I can pick an arbitrary length above the "null" length of 273 characters (for my config of ink) and do what I need, but this is less than clean.

            How about an "inkIsEmpty" function?
            Last edited by CarlMPearson; 01-07-2016, 07:19 PM. Reason: Check AutoCommit
            Carl ~ Dallas, TX
            I'm so old that pool balls came with Roman Numerals

            Comment


              #7
              Re: Ink Control Capabilities

              Originally posted by CarlMPearson View Post
              I'm trying to determine if an INK is empty or has been signed.
              Then I can lock down some values that can no longer be modified without erasing the signature.

              A getValue on the control does not return characters, nor can I determine its length or size.
              How best to determine if the control is occupied?
              Ink_Signature is Control Type INK and a type of Character.

              These return a zero length string and a len of zero.
              Think: signatureIsEmpty for Ink.

              var ink = {dialog.Object}.getValue('Ink_Signature');
              var len = ink.length;

              alert('Ink:' + len + ' ('+ink+')');

              ================ Revised ========================

              AutoCommit Checked.

              Now I get a few hundred characters when empty, but a lot more when signed. I can pick an arbitrary length above the "null" length of 273 characters (for my config of ink) and do what I need, but this is less than clean.

              How about an "inkIsEmpty" function?
              Hello Carl!

              With AutoCommit checked, the ink control should be flagged as dirty whenever edits have been made to the control. You can call {dialog.object}.getControlDirty('NAME_OF_INK_CONTROL') to determine if there have been edits.

              Is this sufficient for your needs?
              Sarah Mitchell
              Director of Customer Success | [URL="https://www.alphasoftware.com"]Alpha Software Corporation[/URL]
              [B]Get in the know! [/B] Join us for our Weekly Webinars: [URL="https://www.alphasoftware.com/weekly-transform-tuesday-webinar"]TransForm Tuesday[/URL] and [URL="https://www.alphasoftware.com/weekly-alpha-anywhere-overview-webinar"]Wednesday's Alpha Anywhere Demo and Q&A[/URL]
              Connect with us: [URL="https://www.instagram.com/alpha_software_corp/"]Instagram[/URL] | [URL="https://twitter.com/AlphaSoftware"]Twitter[/URL] | [URL="https://www.facebook.com/AlphaSoftware/"]Facebook[/URL] | [URL="https://www.linkedin.com/company/alpha-software"]LinkedIn[/URL] | [URL="https://www.youtube.com/user/AlphaSoftwareInc"]YouTube[/URL]

              Comment


                #8
                Re: Ink Control Capabilities

                Originally posted by CarlMPearson View Post
                I'm trying to determine if an INK is empty or has been signed.
                Then I can lock down some values that can no longer be modified without erasing the signature.

                A getValue on the control does not return characters, nor can I determine its length or size.
                How best to determine if the control is occupied?
                Ink_Signature is Control Type INK and a type of Character.

                These return a zero length string and a len of zero.
                Think: signatureIsEmpty for Ink.

                var ink = {dialog.Object}.getValue('Ink_Signature');
                var len = ink.length;

                alert('Ink:' + len + ' ('+ink+')');

                ================ Revised ========================

                AutoCommit Checked.

                Now I get a few hundred characters when empty, but a lot more when signed. I can pick an arbitrary length above the "null" length of 273 characters (for my config of ink) and do what I need, but this is less than clean.

                How about an "inkIsEmpty" function?
                Hello Carl!

                I spent some more time on this for you. Checking if the control is dirty doesn't exactly tell you if the ink control contains any strokes.

                If there are any strokes in the ink control, the getValue() method returns them listed at the end of the ink value after the json settings. You can parse this value to determine if the these strokes exist:

                Code:
                function isInkEmpty (inkCtrl) {
                    var empty = true;
                
                    // get ink value
                    var ink = {dialog.object}.getValue(inkCtrl);
                
                    if (!ink) {
                        // no data from getValue; return empty
                        // could also return something else to indicate than the inkCtrl didn't exist...
                        return empty;
                    }
                    // find starting position where ink stroke data should be if it exists
                    var pos = ink.lastIndexOf("%json%") + 6;
                
                    // get the stroke information - could be empty
                    var strokes = ink.substr(pos);
                
                    // remove all whitespace (empty state could have a newline character in it)
                    strokes = strokes.replace(/\s/g,"");
                
                    // get the length; will be zero if no strokes.
                    var hasStrokes = strokes.length > 0;
                    
                    if (hasStrokes) {
                        empty = false;
                    }
                
                    return empty;
                }
                For the ink data itself, the ink control has a data property. You can get the ink control using the {dialog.object}.getControl('CONTROL_NAME'). Inside the data property are several member items that contain information such as the state (data.state), points (data.pts), and strokes (data.strokes) in the ink control.

                Code:
                var inkCtrl = {dialog.object}.getControl('INK_CTRL');
                
                // dump ink data to the console window
                console.log(inkCtrl.data);
                If auto commit is turned off, you will need to check the length of the data.strokes property to determine if the ink control is empty rather than using the getValue() method of the UX component.



                A question for you:

                What is your use case for using the ink control that you need to know if it contains any strokes? From the way you phrased your question, it sounds like you're trying to get signatures? Why are you using the ink control rather than the signature capture control?
                Sarah Mitchell
                Director of Customer Success | [URL="https://www.alphasoftware.com"]Alpha Software Corporation[/URL]
                [B]Get in the know! [/B] Join us for our Weekly Webinars: [URL="https://www.alphasoftware.com/weekly-transform-tuesday-webinar"]TransForm Tuesday[/URL] and [URL="https://www.alphasoftware.com/weekly-alpha-anywhere-overview-webinar"]Wednesday's Alpha Anywhere Demo and Q&A[/URL]
                Connect with us: [URL="https://www.instagram.com/alpha_software_corp/"]Instagram[/URL] | [URL="https://twitter.com/AlphaSoftware"]Twitter[/URL] | [URL="https://www.facebook.com/AlphaSoftware/"]Facebook[/URL] | [URL="https://www.linkedin.com/company/alpha-software"]LinkedIn[/URL] | [URL="https://www.youtube.com/user/AlphaSoftwareInc"]YouTube[/URL]

                Comment


                  #9
                  Re: Ink Control Capabilities

                  Hello Everyone!

                  A new method has been added in the next release of the Beta:

                  {dialog.object}.inkIsEmpty(ControlName)

                  This method will return a boolean true/false value indicating whether or not an ink control is empty. Example

                  Code:
                  var empty = {dialog.object}.inkIsEmpty('Ink1');
                  if (empty) {
                      alert("Ink1 is empty.");
                  } else {
                      alert("Ink1 is not empty.");
                  }
                  The inkIsEmpty method will be available in tomorrow's build.
                  Sarah Mitchell
                  Director of Customer Success | [URL="https://www.alphasoftware.com"]Alpha Software Corporation[/URL]
                  [B]Get in the know! [/B] Join us for our Weekly Webinars: [URL="https://www.alphasoftware.com/weekly-transform-tuesday-webinar"]TransForm Tuesday[/URL] and [URL="https://www.alphasoftware.com/weekly-alpha-anywhere-overview-webinar"]Wednesday's Alpha Anywhere Demo and Q&A[/URL]
                  Connect with us: [URL="https://www.instagram.com/alpha_software_corp/"]Instagram[/URL] | [URL="https://twitter.com/AlphaSoftware"]Twitter[/URL] | [URL="https://www.facebook.com/AlphaSoftware/"]Facebook[/URL] | [URL="https://www.linkedin.com/company/alpha-software"]LinkedIn[/URL] | [URL="https://www.youtube.com/user/AlphaSoftwareInc"]YouTube[/URL]

                  Comment


                    #10
                    Re: Ink Control Capabilities

                    I wanted to get comfortable with INK as I eventually intend to use it for annotation of photos and drawings.
                    Signature capture is a byproduct or alternate use.

                    Once a signature is captured, I lock important controls whose value should never change once approved.
                    Right now a length over/under 300 length is good enough. Crude, but effective.

                    Next challenge ... showing the INK in a grid or PDF report.

                    I'm using the last release with Feature Pack numbers I got when I was at the Conference in Boston so I'm not totally legit.

                    I'm looking forward to the next release with the cool stuff for tablets.
                    Last edited by CarlMPearson; 01-15-2016, 12:26 PM.
                    Carl ~ Dallas, TX
                    I'm so old that pool balls came with Roman Numerals

                    Comment


                      #11
                      Re: Ink Control Capabilities - INK in a LIST?

                      I have latest developer and server installed. 2999_ 4519 and the license is current.

                      I need to put an INK control in a LIST on a Web UX.

                      Selwyn has a video that shows an INK control, but my developer does not. See images.

                      http://www.ajaxvideotutorials.com/V1...mview_ink2.swf

                      I have INK as a control and using it on tablets, but not in the List_Builder. I have collected 1,000s of inks and now time to display them.

                      Is this a feature only in the yet-to-be-released TABLET version? Am I missing a Feature Pack? I have a Feature Pack for the Ink control installed.
                      Attached Files
                      Carl ~ Dallas, TX
                      I'm so old that pool balls came with Roman Numerals

                      Comment


                        #12
                        Re: Ink Control Capabilities - INK in a LIST?

                        Originally posted by CarlMPearson View Post
                        I have latest developer and server installed. 2999_ 4519 and the license is current.

                        I need to put an INK control in a LIST on a Web UX.

                        Selwyn has a video that shows an INK control, but my developer does not. See images.

                        http://www.ajaxvideotutorials.com/V1...mview_ink2.swf

                        I have INK as a control and using it on tablets, but not in the List_Builder. I have collected 1,000s of inks and now time to display them.

                        Is this a feature only in the yet-to-be-released TABLET version? Am I missing a Feature Pack? I have a Feature Pack for the Ink control installed.
                        Hello Carl,

                        The Ink control is part of the feature set available in the Tablet Beta, which was first introduced about the same time as Build 2999_4519. Beta features are constantly under development and improvements are being made daily. These beta features include rich data including ink, audio and video; ViewBoxes; FormViews; and Editors and Editor Sets.

                        The Ink data type for Lists was introduced in a beta build released sometime after Build 2999_4519.

                        You can download the install for the current beta version of Alpha Anywhere here: http://www.alphasoftware.com/tablet/beta/install.asp
                        Sarah Mitchell
                        Director of Customer Success | [URL="https://www.alphasoftware.com"]Alpha Software Corporation[/URL]
                        [B]Get in the know! [/B] Join us for our Weekly Webinars: [URL="https://www.alphasoftware.com/weekly-transform-tuesday-webinar"]TransForm Tuesday[/URL] and [URL="https://www.alphasoftware.com/weekly-alpha-anywhere-overview-webinar"]Wednesday's Alpha Anywhere Demo and Q&A[/URL]
                        Connect with us: [URL="https://www.instagram.com/alpha_software_corp/"]Instagram[/URL] | [URL="https://twitter.com/AlphaSoftware"]Twitter[/URL] | [URL="https://www.facebook.com/AlphaSoftware/"]Facebook[/URL] | [URL="https://www.linkedin.com/company/alpha-software"]LinkedIn[/URL] | [URL="https://www.youtube.com/user/AlphaSoftwareInc"]YouTube[/URL]

                        Comment


                          #13
                          Re: Ink Control Capabilities - INK in a LIST?

                          I was at DevCon 2015 and put in a Feature Pack for Ink and it came alive (but apparently just partially) on 2999-4519.

                          Tablet was to be a release version "Shortly" and it is 5-6 months later and still in Beta. Grrr.

                          The customer won't allow a Beta as the system is very much in use ... and I agree.

                          But the question is answered, nonetheless. Thanks.
                          Carl ~ Dallas, TX
                          I'm so old that pool balls came with Roman Numerals

                          Comment

                          Working...
                          X