Tag a photo

Last post 08-21-2009 3:31 AM by maverickhyd. 5 replies.

Sort Posts:

  • Tag a photo

    08-19-2009, 7:49 AM
    • Member
      point Member
    • pavani
    • Member since 10-13-2008, 9:23 AM
    • Posts 23

    Hi..

    i need a functionality  to tag a photo .. just like in orkut

  • Re: Tag a photo

    08-19-2009, 9:22 AM
    • Contributor
      2,387 point Contributor
    • maverickhyd
    • Member since 03-25-2009, 2:38 AM
    • Posts 414

     Hi,

    You can do by Using JQuery

     Are you Looking as shown in The below Post?

    http://forums.asp.net/t/1440680.aspx

    Please Mark as Answer if it helped You!
  • Re: Tag a photo

    08-19-2009, 9:52 AM
    • Member
      2 point Member
    • TheArmyBoy
    • Member since 08-19-2009, 1:47 PM
    • Posts 1

    i want to tag photos like in facebook . how should i do it ? Jobs  thanks in advance !

  • Re: Tag a photo

    08-20-2009, 3:15 AM
    • Member
      point Member
    • pavani
    • Member since 10-13-2008, 9:23 AM
    • Posts 23

    Hi,

    yes am looking what u have given in the url

    i have seen your previous post urls

    but am not able to understand where can i save the previous notes(annotations)? and how to populate the notes again when mouse over on the image?

    can u please help me

  • Re: Tag a photo

    08-20-2009, 4:50 AM
    Answer
    Remember to click “Mark as Answer” on the post, if it helps you. Because It helps others to find the solution.

    Srinivas Kotra.


  • Re: Tag a photo

    08-21-2009, 3:31 AM
    • Contributor
      2,387 point Contributor
    • maverickhyd
    • Member since 03-25-2009, 2:38 AM
    • Posts 414

    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));

     

    Please Mark as Answer if it helped You!
Page 1 of 1 (6 items)