Hi,
for Image Annotations fallow these steps
1) create a div on Page and set the url property with your image
<div id="containment-wrapper" style="background-image: url(3666142658_d46ddf5262.jpg); height:350px;width:500px">
The height & width of the image and The Position Should be fix
2)
create another div inside the image div. This div is for selecting area on the image
<div id="containment-wrapper" style="background-image: url(3666142658_d46ddf5262.jpg); height:350px;width:500px">
<div id="draggable3" style="height:50px; width:54px">
<div id="resizable"style="border: thin groove #FFFFFF; height: 58px; width: 59px;"></div>
<div>
<table>
<tr><td colspan="3"><textarea class="xyz" rows="1" id="notes_text_area" cols="4" >Add Notes Here</textarea></td></tr>
<tr>
<td>
<input type="button" style="margin: 5px 5px 0pt 0pt;" value="Save" class="Butt" onclick="Save();" id="btnSave"/>
</td>
<td>
<input type="button" style="margin: 5px 5px 0pt 0pt; height: 26px;" value="Cancel" onclick="Hide();" id="btnCancel"/>
</td>
<td>
<input type="button" style="margin: 5px 5px 0pt 0pt; height: 26px;" value="Delete" id="btnDelete"/>
</td>
</tr></table>
</div></div>
<%--<div id="content"></div>--%>
</div>
3) by adding Jquery resizableable, dragable in pageload you can drag drop,resize the div on Image
<script type="text/javascript">
$(document).ready(function() {
$("#draggable3").draggable({ containment: '#containment-wrapper', scroll: false });
$("#resizable").resizable();
$("#btnDelete").hide();
});
Now your template is Ready
4) How to save the selected X & Y Positions when you pressing save button?
you can get the div postions using Ajax for this you have to use script Manager
var posX = Sys.UI.DomElement.getBounds($get("draggable3")).x;
var posY = Sys.UI.DomElement.getBounds($get("draggable3")).y;
Now Create a webmethod in page for saving x & Y positions of image
[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]
public static string AddAnnotation(string PosX, string PosY)
{
//code here for Insert into Database
}
use the $.ajax to save the x & Y postions on Database
$.ajax({
type: "POST",
url: "Default2.aspx/AddAnnotation",
data: "{'PosX':'" + Sys.UI.DomElement.getBounds($get("draggable3")).x + "','PosY':'" + Sys.UI.DomElement.getBounds($get("draggable3")).y + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
}
{);
Now Insertion of Notes is done. The same way You can do for delete & Show Tags on Image
use pagemethods to display,delete data using jquery
Jquery having having lot of functions like mouseover,mouseout you can use those for showing and hiding Notes on Image
you can get prev tags list using jquery $.ajax and creating a page method. for example getTagList
use this for set element location on image
Sys.UI.DomElement.setLocation(elementRef, Number(posX), Number(posY));