Get Image name from Image Gallery

Last post 02-25-2014, 9:11 PM by Donna111. 13 replies.
Sort Posts: Previous Next
  •  11-29-2013, 3:05 AM 78461

    Get Image name from Image Gallery

    Hi,

     

            I  am using ASP.Net image Gallery in my website. I am showing this gallery in a popup window on button click. now my

    requirement  is that  I want to select a particular image and I want to get that particular image value. when i selecting particular image

    the image will be highlighted and popup wants to be closed. How can I achieve this..

     

    Please give me reply, it's urgent   for me..

     

    Thanks in advance..! 


    Regards,
    Narendra
    Filed under:
  •  11-29-2013, 8:14 AM 78465 in reply to 78461

    Re: Get Image name from Image Gallery

    Hi narendrababu,

     

    Which layout you are using? Classic/Explorer/GridShow/Modern/Prominent/SlideShow?

     

    Regards,

     

    Ken 

  •  12-02-2013, 2:23 AM 78473 in reply to 78465

    Re: Get Image name from Image Gallery

    I am using Classic Layout..
    Regards,
    Narendra
  •  12-02-2013, 2:39 AM 78476 in reply to 78473

    Re: Get Image name from Image Gallery

    Hi narendrabadu,

     

    1. Please open file "\CuteSoft_Client\Gallery\Layout\Classic\Code.js" 

     

    2. Find section below

     

    img.onclick=ToDelegate(this,function()

          {

                this.Browser.ShowViewer(div.dngphoto);

    }); 

    3. The sectin above is the image click event, you can get the image info in it. 

     

    1. img.onclick = ToDelegate(thisfunction () {  
    2.     //photo.Title  
    3.     //photo.CategoryID  
    4.     //photo.Url  
    5.        //photo.Thumbnail  
    6.     this.Browser.ShowViewer(div.dngphoto);  
    7. });  
     

    Regards,

     

    ken 

  •  12-02-2013, 5:17 AM 78478 in reply to 78476

    Re: Get Image name from Image Gallery

    Thanks..   It's working fine, But I want by default the first image in the gallery will be selected, It means that the border colour for first 

    image wants to be changed like some colour "#AD1829" and when I clicked on that image the gallery popup will be dissappeared.

     

    Please help me..

     

    Thanks in advance.. 


    Regards,
    Narendra
  •  12-03-2013, 12:43 AM 78486 in reply to 78478

    Re: Get Image name from Image Gallery

    I want by default the first image in the gallery will be selected, It means that the border colour for first image wants to be changed like some colour "#AD1829" and when I clicked on that image the gallery popup will be disappeared.

     

     Is there a search function on this based on tags or comments on the image?  

     

    Please help me, It's urgent for me..



    Regards,
    Narendra
  •  12-03-2013, 8:49 AM 78492 in reply to 78486

    Re: Get Image name from Image Gallery

    Hi narendrababu,

     

    1. Open file \CuteSoft_Client\Gallery\Layout\Classic\Code.js

     

    2. Find section below 

     

    1. img.onclick=ToDelegate(this,function()  
    2. {  
    3.     this.Browser.ShowViewer(div.dngphoto);  
    4. });  
     

    3. Change it to

     

    1. img.onclick = ToDelegate(thisfunction () {  
    2.      for (var j = 0; j < document.getElementsByClassName("GalleryPhotoItem").length; j++) {  
    3.          if (document.images[j].className == "GalleryThumbnailImage") {  
    4.              document.images[j].parentElement.style.border = "";  
    5.          }  
    6.          if (document.images[j].src.substr(document.images[j].src.lastIndexOf("/") + 1) == photo.Thumbnail.substr(photo.Thumbnail.lastIndexOf("/") + 1)) {  
    7.              document.images[j].parentElement.style.border = "solid 3px red";  
    8.          }  
    9.      }  
    10.   
    11.  });  
     

    4. Find section below

     

    1. div.ondblclick=ToDelegate(this,function()  
    2.     {  
    3.         this.Browser.ShowViewer(div.dngphoto);  
    4.     });  
    5. Change it to

     

    1. div.ondblclick=ToDelegate(this,function()  
    2.     {  
    3.     });  

    Regards,
     
    Ken 
  •  12-03-2013, 9:07 AM 78493 in reply to 78492

    Re: Get Image name from Image Gallery

    Hi,

     

          Is there any search functionality in the Image Gallery (Classic Layout). I want to search an image by it's name or 

    it's comment's. 

     

    Please Give Quick reply.. 

     

    I am waiting for your response.. 


    Regards,
    Narendra
  •  12-04-2013, 8:05 AM 78502 in reply to 78493

    Re: Get Image name from Image Gallery

    Hi narendrababu,

     

    The gallery has not the search function, sorry for your inconvenience.

     

    Regards,

     

    Ken 

  •  12-12-2013, 6:22 AM 78585 in reply to 78502

    Re: Customize the image show viewer in the image gallery

     

    Hi,

                    Where can I found   "this.Browser.ShowViewer(div.dngphoto);"   function to customize the popup window 

     

    comes when I clicked on the image in the Gallery (Classic Layout). I want to put "Ok" button in that popup along with 

     

    "Close"  button.

     

    Please Give Quick reply.. 


    Regards,
    Narendra
  •  12-12-2013, 8:15 AM 78588 in reply to 78585

    Re: Customize the image show viewer in the image gallery

    Hi narendrababu,

     

    Please open file  "\CuteSoft_Client\Gallery\Viewer\LightBox\Code.js", find the section below. that is the open photo function.

     

    GalleryViewer.prototype.Show=function _GalleryViewer_Show(photo)

     

    Regards,

     

    Ken 

  •  12-16-2013, 2:38 AM 78601 in reply to 78588

    Re: Customize the image show viewer in the image gallery

    Hi,

                  I am Using Image Gallery (Classic Layout). I want to set paging functionality (asynchronously) to that image gallery.

     

    How can I achieve this.. 

     

    Please Try to give Quick Reply... 


    Regards,
    Narendra
  •  12-16-2013, 8:22 AM 78607 in reply to 78601

    Re: Customize the image show viewer in the image gallery

    Hi narendrababu,

     

    Please open file "CuteSoft_Client\Gallery\Layout\Classic\Code.js", clean all the code then use the new code below.

     

    The first line "var GRIDSHOW_PAGESIZE=5;" use to set how many images to show in 1 page. 

    1. var GRIDSHOW_PAGESIZE=5;  
    2. function GalleryLayout(gb)  
    3. {  
    4.     this.Browser=gb;  
    5.   
    6.     this.dng_photolist=this.Browser.FindElement("dng_photolist");  
    7.       
    8.       
    9.       
    10.     this.Browser.Control.style.minHeight=this.Browser.Control.style.height;  
    11.     this.Browser.Control.style.height="";  
    12.       
    13.     var uploadercontainer=this.Browser.GetUploaderContainer();  
    14.     if(uploadercontainer)  
    15.     {  
    16.         this.Browser.FindElement("dng_uploaderholder").appendChild(uploadercontainer);  
    17.     }  
    18.     else  
    19.     {  
    20.   
    21.     }  
    22.       
    23.     this._categories=this.Browser.GetCategories();  
    24.   
    25.     this.DrawUI();  
    26. }  
    27.   
    28. GalleryLayout.prototype.DrawUI=function _GalleryLayout_DrawUI()  
    29. {  
    30.     clearTimeout(this._animationTimerid);  
    31.       
    32.     this.dng_photolist.innerHTML="";  
    33.       
    34.     var photos=[];  
    35.     for(var i=0;i<this._categories.length;i++)  
    36.     {  
    37.         photos=photos.concat(this._categories[i].Photos);  
    38.     }  
    39.     var page=this._page||1;  
    40.     var size=GRIDSHOW_PAGESIZE;  
    41.     var start=(page-1)*size;  
    42.         for(var i=0;i<size;i++)  
    43.     {  
    44.         var photo=photos[start+i];  
    45.         if(!photo)  
    46.             break;  
    47.         var div=this.CreatePhotoDiv(photo);  
    48.         this.AttachItemEvent(div);  
    49.         this.dng_photolist.appendChild(div);  
    50.     }  
    51.         var pagecount=Math.ceil(photos.length/size);  
    52.     if(pagecount==0)  
    53.         return;  
    54.     if(pagecount==1&&page==1)  
    55.         return;  
    56.         //draw pager :  
    57.     var pager=document.createElement("DIV");  
    58.     pager.style.textAlign="left";  
    59.     pager.style.clear="both";  
    60.     this.dng_photolist.appendChild(pager);  
    61.     var layout=this;  
    62.     function SetupButton(btn,btnpage)  
    63.     {  
    64.         if(page==btnpage)  
    65.         {  
    66.             btn.style.fontWeight="bold";  
    67.         }  
    68.         btn.innerHTML="["+btnpage+"]";  
    69.         btn.href="#";  
    70.         btn.onclick=ToDelegate(layout,function()  
    71.         {  
    72.             this._page=btnpage;  
    73.             this.DrawUI();  
    74.             return false;  
    75.         });  
    76.     }  
    77.       
    78.     for(var i=0;i<pagecount;i++)  
    79.     {  
    80.         var btn=document.createElement("A");  
    81.         SetupButton(btn,i+1);  
    82.         pager.appendChild(btn);  
    83.         pager.appendChild(document.createTextNode(" "));  
    84.     }  
    85.       
    86. }  
    87.   
    88. GalleryLayout.prototype.CreatePhotoDiv=function _GalleryLayout_CreateItemDiv(photo)  
    89. {  
    90.     var div=document.createElement("DIV");  
    91.     div.className="GalleryPhotoItem";  
    92.     div.dngphoto=photo;  
    93.     var t=document.createElement("TABLE");  
    94.     t.style.width="100%";  
    95.     t.style.height="100%";  
    96.     t.border=0;  
    97.     t.cellSpacing=0;  
    98.     t.cellPadding=0;  
    99.     var c1=t.insertRow(-1).insertCell(-1);  
    100.     var c2=t.insertRow(-1).insertCell(-1);  
    101.     c1.className="GalleryItemImageCell";  
    102.     c1.onselectstart=new Function("","return false");  
    103.     c2.style.textAlign="center";  
    104.     var scale = Math.min(128/photo.Width, 96/photo.Height);  
    105.     var img=this.Browser.CreateThumbnail(photo.Thumbnail,Math.floor(photo.Width * scale),Math.floor(photo.Height * scale));  
    106.     c1.appendChild(img);  
    107.     img.style.cursor="hand";  
    108.     img.onclick=ToDelegate(this,function()  
    109.     {  
    110.         this.Browser.ShowViewer(div.dngphoto);  
    111.     });  
    112.       
    113.     c2.innerHTML="<span class='GalleryItemText'></span>";  
    114.     var titltText=photo.Title;  
    115.     if(titltText&&titltText.length>30)titltText=titltText.substring(0,30)+"..";  
    116.     c2.firstChild.appendChild(document.createTextNode(titltText));  
    117.       
    118.     if(this.Browser.Param.AllowShowComment)  
    119.     {  
    120.         var cs=photo.Comments;  
    121.         if(cs&&cs.length)  
    122.         {  
    123.             c2.innerHTML+="<br/><span class='GalleryItemNumComments'>"+cs.length+" "+GalleryLocalize.NUMCOMMENTS+"<span>";  
    124.         }  
    125.     }  
    126.       
    127.     div.appendChild(t);  
    128.     return div;  
    129. }  
    130.   
    131. GalleryLayout.prototype.AttachItemEvent=function _GalleryLayout_AttachItemEvent(div)  
    132. {  
    133.     function SetDivClass(div)  
    134.     {  
    135.         var clsname;  
    136.         if(div.dngselected&&div.dnghover)  
    137.             clsname=" GalleryItemHoverSelected";  
    138.         else if(div.dngselected)  
    139.             clsname=" GalleryItemSelected";  
    140.         else if(div.dnghover)  
    141.             clsname=" GalleryItemHover";  
    142.         else  
    143.             clsname="";  
    144.         div.className="GalleryPhotoItem "+clsname;  
    145.     }  
    146.     div.onmouseover=ToDelegate(this,function()  
    147.     {  
    148.         div.dnghover=true;  
    149.         SetDivClass(div);  
    150.         this.Browser.ShowPhotoTooltip(div.dngphoto,div,this);  
    151.     });  
    152.     div.onmouseout=ToDelegate(this,function()  
    153.     {  
    154.         div.dnghover=false;  
    155.         SetDivClass(div);  
    156.     });  
    157.     div.ondblclick=ToDelegate(this,function()  
    158.     {  
    159.         this.Browser.ShowViewer(div.dngphoto);  
    160.     });  
    161.     div.oncontextmenu=ToDelegate(this,function(event)  
    162.     {  
    163.         event=event||window.event;  
    164.         this.Browser.ShowPhotoMenu(div.dngphoto,div,event,this);  
    165.         if(event.preventDefault)event.preventDefault();  
    166.         event.cancelBubble=true;  
    167.         return event.returnValue=false;  
    168.     });  
    169. }  
    170.   
    171. GalleryLayout.prototype.Ajax_Result=function _GalleryLayout_Ajax_Result(ret,param,method)  
    172. {  
    173.     if(method=="GetAllCategoryData"||method=="GetCategoryData")  
    174.     {  
    175.         this._categories=this.Browser.GetCategories();  
    176.         this.DrawUI();  
    177.     }  
    178. }  
    Regards,

     

    Ken 

     

     

  •  02-25-2014, 9:11 PM 79970 in reply to 78461

    Re: Get Image name from Image Gallery

     Hi there

    I am a beginner of  ASP.Net image Gallery.It's indeed more convenient for a beginner to do some image process using a fine tool.

    You said that you  want to select a particular image and get that particular image value.I have never tried to do that before,and that exactly what i want to do.I just want to know that if there is an easier method to complete that process.Thanks for any suggestions.

View as RSS news feed in XML