- Aurigma Graphics Mill 5.5 for .NET
- Introduction
- What's New?
- Overview of Features
- Getting Started
- Programming with Graphics Mill for .NET
- Image Processing with Graphics Mill for .NET
- Using Graphics Mill for .NET in Windows Applications
- Using Graphics Mill for .NET in Web Applications
- AjaxControls
- WebControls (Obsolete)
- Image Processing in ASP.NET
- Scalability and Reliability of Web Applications
- Creating Imagery for Mobile Devices
- FAQ: Using Graphics Mill for .NET
- File Formats
- Graphics Mill for .NET Add-ons
- Class Library Reference
- Samples
- Licensing
- Copyright Notices
Client-Side Object Model (Web Controls)
The classes from Aurigma.GraphicsMill.WebControls provide not only server-side properties, methods, and events. They are inseparably linked with the appropriate JavaScript code which allows to work with these controls on the client side (i.e. without having to run any code on the server). This way most members of these classes are doubled in JavaScript.
We have followed the following convensions:
- All members are called in the JavaScript-style camel notation, i.e. all the words in the member name are capitalized except of the first one: it is written in the lowercase, e.g. someClassMember().
- The name of the methods based on the server properties are constructed in the following
way:
- The property reader method has the word get prepended to the appropriate property name, i.e. getPropertyName . For example, getZoom.
- The property writer method has the word set prepended to the appropriate property name, i.e. setPropertyName . For example, setZoom.
- The events are represented in the following ways:
-
- The method that attaches an event handler has the word add prepended to the appropriate event name, i.e. addEventName . For example, addBitmapChanged.
- The method that detaches an event handler has the word remove prepended to the appropriate event name, i.e. removeEventName . For example, removeBitmapChanged.
- Members that accept enumeration as an argument actually accept strings. This string should contain a name of the enumeration member without a namespace prefix. E.g. setZoomMode method can accept such strings as "None", "BestFit", "FitToWidth", and other member names of the ZoomMode enumeration.
- The members that have some appearance parameters such as colors, line styles, etc. are using HTML-compatible syntax. E.g. colors can be named (red, green, black) or specified in hex in HTML syntax (#FF0000, #00FF00, #000000).
When you need to refer the control instance in the JavaScript, use the ClientID of this control (using the ClientID property). Use <%=control.ClientID%> syntax for that.
Simple code samples demonstrating how to use Graphics Mill for .NET web controls in the JavaScript are shown below.
Syntax Convetion
Properties
getMyProperty()
setMyProperty(value)
Here is a simple JavaScript which uses setZoom property to change the bitmap viewer zoom:
<script language="javascript">
function windowOnLoad(){
var bv=document.getElementById("<%=BitmapViewer1.ClientID%>");
bv.setZoom(0.5);
}
window.onload=windowOnLoad;
</script>
Methods
myMethod()
This simple JavaScript demonstrates how to use method erase to clear the selection from the control.
<script language="javascript">
function buttonClick(){
var r=document.getElementById("<%=RectangleRubberband1.ClientID%>");
r.erase();
}
</script>
Events
addMyEvent(
handler : Function,
destination : Object
)
removeMyEvent(
handler : Function,
destination : Object
)
The code below demonstrates how to add the client-side event handler for the Zoomed event. In this event handler we display an actual zoom value in the drop-down list.
<script language="javascript">
function bitmapViewer_Zoomed(){
document.getElementById("inputZoom").value = Math.round(bitmapViewer1.getZoom()*100) + "%";
}
function windowOnLoad(){
var bv=document.getElementById("<%=BitmapViewer1.ClientID%>");
bitmapViewer1.addZoomed(bitmapViewer_Zoomed, this);
}
window.onload=windowOnLoad;
</script>
Object Model
Web Controls Classes
- BitmapViewer
- PanNavigator
- ZoomInNavigator
- ZoomOutNavigator
- ZoomRectangleResponsible
-
RectangleRubberband
- getRectangle / setRectangle (Rectangle)
Auxiliary Classes
Web Controls Classes
BitmapViewer Class
Properties
| Member Name | Client-Side Syntax | Description |
|---|---|---|
| AutoPostBack |
JavaScript
|
Gets/sets a value indicating whether a postback to the server occurs automatically when the user zooms or scrolls the bitmap. |
| Bitmap |
JavaScript
|
Gets/sets a bitmap which is displayed on the control. |
| N/A |
JavaScript
|
When a remote scripting method fails, this method returns the exception name. If the method succeeded, an empty string is returned. To determine when remote method completes, use StatusChanged event (see addStatusChanged/removeStatusChanged methods below). |
| N/A |
JavaScript
|
When a remote scripting method fails, this method returns the exception description. If the method succeeded, empty string returned. To determine when the remote method is completed, use StatusChanged event (see addStatusChanged/removeStatusChanged methods below). |
| MaxZoom |
JavaScript
|
Gets/sets the maximum allowed zoom value. |
| MinZoom |
JavaScript
|
Gets/sets the minimum allowed zoom value. |
| Navigator |
JavaScript
|
Gets/sets the navigator control ID. |
| N/A |
JavaScript
|
When a remote scripting method is completed, this method returns its return value. To determine when the remote method is completed, use StatusChanged event (see addStatusChanged/removeStatusChanged methods below). |
| Rubberband |
JavaScript
|
Gets/sets the rubberband control ID. |
| ScrollBarsStyle |
JavaScript
|
Gets/sets a value that specifies when to display the scroll bars. |
| ScrollBarWidth |
JavaScript
|
Gets a value that specifies width of a scroll bar . |
| ScrollingPosition |
JavaScript
|
Gets/sets a position of the scroll bars. |
| N/A |
JavaScript
|
Gets a current bitmap status. It can be one of the following values:
|
| Zoom |
JavaScript
|
Gets/sets the current zoom value. |
| ZoomMode |
JavaScript
|
Gets/sets the zooming behavior of the control (automatic or manual). |
| ZoomQuality |
JavaScript
|
Gets/sets the value that specifies a zoom quality. |
Methods
| Member Name | Client-Side Syntax | Description |
|---|---|---|
| N/A |
JavaScript
|
Converts X and Y point values from the bitmap-related coordinates to the control-related ones. |
| N/A |
JavaScript
|
Converts X and Y point values from the control-related coordinates to the bitmap-related ones. |
| N/A |
JavaScript
|
Runs the specified remote method on the server. Read the Remote Scripting Approach topic for more details. |
| N/A |
JavaScript
|
Indicates that the viewport needs to be refreshed. The actual refreshing is applied when the user does not update the viewport state (such as scroll position, zoom value) in one second. |
| N/A |
JavaScript
|
Refreshes the viewport immediately. |
Events
| Member Name | Client-Side Syntax | Description |
|---|---|---|
| Click |
JavaScript
|
Fires when the image displayed in the control is clicked. |
| BitmapChanged |
JavaScript
|
Fires when the Bitmap property is changed or this bitmap is updated. |
| Scrolled |
JavaScript
|
Fires when some scroll bar was moved. |
| N/A |
JavaScript
|
Fires when bitmap status (see getStatus method) is updated. Using this method you can determine when the remote scripting method was stopped. To do it, this event handler should analyze the value returned with the getStatus method. If it is "Ready", the remote method has been completed. If it is "Busy", the remote method has been started. If it is "Refresh", the bitmap is not modified, but the viewport is downloading a portion of the image (e.g. when user zoomed or scrolled the image). |
| Zoomed |
JavaScript
|
Fires when the bitmap is zoomed in this BitmapViewer control. |
PanNavigator
Methods
| Member Name | Client-Side Syntax | Description |
|---|---|---|
| Connect(BitmapViewer) |
JavaScript
|
Connects this navigator to the BitmapViewer control. |
| Connect(BitmapViewer) |
JavaScript
|
Disconnects this navigator from the BitmapViewer control. |
ZoomInNavigator
Methods
| Server-Side Member Name | Client-Side Member Name | Description |
|---|---|---|
| Connect(BitmapViewer) |
JavaScript
|
Connects this navigator to the BitmapViewer control. |
| Connect(BitmapViewer) |
JavaScript
|
Disconnects this navigator from the BitmapViewer control. |
ZoomOutNavigator
Methods
| Server-Side Member Name | Client-Side Member Name | Description |
|---|---|---|
| Connect(BitmapViewer) |
JavaScript
|
Connects this navigator to the BitmapViewer control. |
| Connect(BitmapViewer) |
JavaScript
|
Disconnects this navigator from the BitmapViewer control. |
ZoomRectangleResponsible
Properties
| Server-Side Member Name | Client-Side Member Name | Description |
|---|---|---|
| OutlineColor |
JavaScript
|
Gets/sets the color of the rectangle outline. |
| OutlineStyle |
JavaScript
|
Gets/sets the rectangle outline pen style (solid, dashed, etc). |
| OutlineWidth |
JavaScript
|
Gets/sets the rectangle outline width. |
Methods
| Member Name | Client-Side Syntax | Description |
|---|---|---|
| Connect(BitmapViewer) |
JavaScript
|
Connects this navigator to the BitmapViewer control. |
| Connect(BitmapViewer) |
JavaScript
|
Disconnects this navigator from the BitmapViewer control. |
RectangleRubberband
Properties
| Member Name | Client-Side Syntax | Description |
|---|---|---|
| AutoPostBack |
JavaScript
|
Gets/sets a value indicating whether a postback to the server automatically occurs when the user stops modifying the rectangle. |
| Erasable |
JavaScript
|
Gets/sets a value that specifies whether the rubberband can be erased (discarded) when the user clicks by a mouse out of this rectangle. |
| GripSize |
JavaScript
|
Gets/sets the grip size. |
| GripsVisible |
JavaScript
|
Gets/sets a value which shows or hides the grips on the rectangle. |
| IsEmpty |
JavaScript
|
Gets a value that specifies whether the rubberband rectangle is empty (and therefore whether it is visible). |
| MaskVisible |
JavaScript
|
Gets/sets a value which specifies whether to display a mask out of the rectangle. |
| Movable |
JavaScript
|
Gets/sets a value which specifies whether the rubberband rectangle can be dragged on the BitmapViewer control. |
| OutlineColor |
JavaScript
|
Gets/sets the color of the rectangle outline. |
| OutlineStyle |
JavaScript
|
Gets/sets the rectangle outline pen style (solid, dashed, etc). |
| OutlineWidth |
JavaScript
|
Gets/sets the rectangle outline width. |
| Ratio |
JavaScript
|
Gets/sets the aspect ratio of the rubberband rectangle which should be preserved when ResizeMode is Proportional. |
| Rectangle |
JavaScript
|
Gets/sets a rubberband rectangle. |
| ResizeMode |
JavaScript
|
Gets/sets an allowed resize mode for the rubberband rectangle. |
Methods
| Member Name | Client-Side Syntax | Description |
|---|---|---|
| Connect(BitmapViewer) |
JavaScript
|
Connects this rubberband to the BitmapViewer control. |
| Connect(BitmapViewer) |
JavaScript
|
Disconnects this rubberband from the BitmapViewer control. |
| Erase() |
JavaScript
|
Erases (discards) the rubberband from the control. |
Events
| Member Name | Client-Side Syntax | Description |
|---|---|---|
| RectangleChanged |
JavaScript
|
Fires when the rubberband rectangle is modified (mouse button is released). |
| N/A |
JavaScript
|
Fires during the rubberband rectangle modification (before the mouse button is released). |
Auxiliary Classed
Bitmap Class
Properties
| Member Name | Client-Side Syntax | Description |
|---|---|---|
| BitsPerPixel |
JavaScript
|
Returns the number of bits per pixel. |
| ColorSpace |
JavaScript
|
Indicates color space of the current bitmap. |
| HasAlpha |
JavaScript
|
Specifies whether current pixel format supports alpha channel (information about opacity of pixels). |
| Height |
JavaScript
|
Returns current bitmap height in pixels. |
| IsCmyk |
JavaScript
|
Indicates if color space of current bitmap is CMYK. |
| IsEmpty |
JavaScript
|
Indicates if bitmap is empty (no bitmap data loaded). |
| IsExtended |
JavaScript
|
Indicates if current pixel format is extended (i.e. 16 bits per channel). |
| IsGrayScale |
JavaScript
|
Indicates if color space of current bitmap is grayscale. |
| IsIndexed |
JavaScript
|
Indicates if current bitmap is indexed (palette-based). |
| IsRgb |
JavaScript
|
Indicates if color space of current bitmap is RGB. |
| PixelFormat |
JavaScript
|
Returns pixel format of the current bitmap. |
| Width |
JavaScript
|
Returns current bitmap width in pixels. |
Point Class
Properties
| Member Name | Client-Side Syntax | Description |
|---|---|---|
| X |
JavaScript
|
Gets or sets the x-coordinate of this Point. |
| Y |
JavaScript
|
Gets or sets the y-coordinate of this Point. |
Rectangle Class
Properties
| Member Name | Client-Side Syntax | Description |
|---|---|---|
| Height |
JavaScript
|
Gets or sets the height of this Rectangle structure. |
| Left |
JavaScript
|
Gets or sets the x-coordinate of the left edge of this Rectangle . |
| Top |
JavaScript
|
Gets or sets the y-coordinate of the top edge of this Rectangle . |
| Width |
JavaScript
|
Gets or sets the width of this Rectangle structure. |
Methods
| Member Name | Client-Side Syntax | Description |
|---|---|---|
| N/A |
JavaScript
|
Creates an exact copy of this Rectangle object. |
RgbColor Class
Properties
| Member Name | Client-Side Syntax | Description |
|---|---|---|
| A |
JavaScript
|
Returns 8-bit alpha channel value (color opacity). |
| B |
JavaScript
|
Returns 8-bit blue channel value. |
| G |
JavaScript
|
Returns 8-bit green channel value. |
| R |
JavaScript
|
Returns 8-bit red channel value. |
CmykColor Class
Properties
| Member Name | Client-Side Syntax | Description |
|---|---|---|
| A |
JavaScript
|
Returns 8-bit alpha channel value (color opacity). |
| C |
JavaScript
|
Returns 8-bit cyan channel value. |
| K |
JavaScript
|
Returns 8-bit black channel value. |
| M |
JavaScript
|
Returns 8-bit magenta channel value. |
| Y |
JavaScript
|
Returns 8-bit yellow channel value. |
GrayScaleColor Class
Properties