SRP Sketch Control
You may have seen the SRP Sketch Control in the wiki only to be disappointed that it was not documented. There was a good reason for that: we weren’t finished with it. This was a control originally built for a specific industry in mind and we needed to work it into a general control with more options. We are proud to officially release the control to our customers, fully documented of course.
The SRP Sketch Control is a utility control which allows users to sketch a diagram pertinent to their industry. For example, a company that builds parts can load up predefined sketches of their available components and users can then tweak or label them to meet specific needs.
The SRP Sketch Control makes it easy for users to sketch an idea. It is not a fully-fledged imaging system on the order of Photoshop. Its goal is to provide end users with efficient sketching and labelling. As a developer, you establish predefined labels and icons so users can rapidly identify important elements of their illustrations. Basic sketching functionality is available, from single lines to complex polygons with annotations.
The SRP Sketch Control creates a multilayered vector graphic that can be saved to the OpenInsight database and exported to various file formats for distribution or printing. The SRP Sketch Control is unique in that it is far more self-contained than other controls. Instead of creating a form and wiring up a bunch of buttons and events, the SRP Sketch Control contains all its own controls and has very few events at all. It’s a turnkey solution to meet the demands of specific industries.
As a developer, you will create a form that contains the SRP Sketch Control and do some work to set it up. Once the setup is established, the SRP Sketch Control will take care of the rest. When the user is ready to save, they will use the same save commands as the rest of your application, at which point you will read the control’s Data property and save it anywhere you wish. You will find this control to be one of the easiest to integrate into your application.
Inside the Sketch
While the ultimate goal of the SRP Sketch Control is to create a single image for printing or viewing, the sketch itself is a bit more complex. It consists of three layers: shapes, text, and icons.
This means that no matter what order you draw certain elements, Icons will always obscure both Shapes and Text, but shapes will never obscure text. Additionally, the text layer does something known as clipping. This is when the boundaries of the text “erase” everything beneath it. This makes labelling very readable as seen here:
The separation of layers makes diagram maintenance easier. When it comes time to export the diagram to a single image, the layers are composited and the image can then be used just about anywhere, including OIPI.
The User Experience
The SRP Sketch Control provides all the basic drawing capabilities expected from even the most rudimentary drawing applications. It supports various shapes, annotations, line styles, and unlimited undo/redo.
The toolbar and left hand panes are built in. The first pane is a general pane that provides easy access to the most common tasks.
The Draw Shape Tool
Perhaps the most interesting task the Draw Shape tool. It allows the user to sketch out a complex shape efficiently. The Draw Shape lets a user build a polygon line by line, like so:
The blue line is the line that hasn’t been place yet. It’s just feedback so the user knows exactly how the line is going to look. There is a clever feature of this tool which allows the user to add curvature to the drawing. By holding down the control key, the user now sees this:
Now the line is a quarter ellipse without the need to switch tools. This gives the user the capability of sketching out complex shapes very quickly.
Once shapes are defined, they can be resized, reshaped, moved, copied, or deleted at will.
The SRP Sketch Control provides general multi-line text annotation with custom Font support. However, it can be horribly inefficient when a lot of industries have standard naming conventions. That why the control supports custom label panes. As the developer, you populate the panes with quick-n-ready labels that the user can just drop with a single click.
This saves the user a lot of time. It’s up to you to decide how the pane is populated. The easiest thing to do is just provide a fixed list of labels, but you can also provide a means for the user to customize the list, which you store in the database.
Like labels, there are times when Icons can be useful ways to identify certain aspects of a sketch. Add any number of icon panes so the user can drop them repeatedly as desired.
The control also supports a Predrawn Objects pane. Then the pane is enabled, new options open up to the user allowing them to save a selected set of shapes as a single object.
The user names the object. Once the predrawn object is defined, the user can select it from the pane and drop it with a single click repeatedly. For example, you can create a predrawn object that represents a frequently used machinery component, or a special symbol on a map. The possibilities are endless.
As you can see, the SRP Sketch Control is fully featured. It requires very little setup and maintenance because the control’s features are self-contained within a fixed user interface. It won’t draw photorealistic landscapes or shiny logos. It will however give your application users the ability to very quickly create a useful visual diagram. Please give the control a try. As always, if you are a Pro control customer, then you now have this control at your disposal at no additional cost.