Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Wednesday, April 19, 2006 8:05:58 PM(UTC)

tlandn  
tlandn

Groups: Registered
Posts: 10


Hi Sir.

Do you have any example using JavaScript to browse thumbnails of a directory?

Thank you very much.

 

 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Thursday, April 20, 2006 12:48:21 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,328

Was thanked: 1 time(s) in 1 post(s)

Hello,

I am afraid we don't have a ready JavaScript sample that shows to browse thumbnails of a directory. But I might be able to create a small JavaScript sample for you.
What is the exact programming interface that you use (COM or OCX)?

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#3 Posted : Thursday, April 20, 2006 1:09:32 AM(UTC)

tlandn  
tlandn

Groups: Registered
Posts: 10


Thank you Sir.

I'm using COM (Ltrtm14e.cab) version 14.5. Wait for your example [Y]

 
#4 Posted : Sunday, April 23, 2006 6:20:52 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,328

Was thanked: 1 time(s) in 1 post(s)

Hello,

I am attaching a small JavaScript sample that shows how to load an image onto lead raster view control, and how to load a multi-page TIFF image onto LEAD Raster image list control as thumbnails.
About browsing images from directory, please check the JavaScript sample code and then refer to the following topic in the LEADTOOLS COM v14.5 help file:
- BrowseDir method (ILEADRasterThumbnail)
- ThumbnailEvent event (ILEADRasterThumbnail)
- Thumbnail Browser

If you still have a problem in loading thumbnail images from a directory, then please let me know.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
File Attachment(s):
LoadLead.zip (2kb) downloaded 27 time(s).
 
#5 Posted : Sunday, April 23, 2006 9:51:19 PM(UTC)

tlandn  
tlandn

Groups: Registered
Posts: 10


Hi Sir!

Your example works fine. But I can't let it work with Thumbnail Browser Control. Here is my code :

<HTML>
   <HEAD>  
       <script language="JavaScript" for="LEADThumb1" event="ThumbnailEvent(Bitmap,szFilename,nStatusCode,nPercent)">
  
   alert("ThumbnailEvent");
  
       </script>
  
  
     <SCRIPT LANGUAGE="JavaScript">
      <!--
       function Window_OnLoad()
       {
        
      LEADThumb1.StopOnError = false;
     LEADThumb1.Filter = "*.*";
     LEADThumb1.ThumbnailWidth= 150;
     LEADThumb1.ThumbnailHeight = 150;
     LEADThumb1.ThumbnailBitsPerPixel = 0;
     LEADThumb1.MaintainAspect = true;
     LEADThumb1.ForceSize = true;

     LEADThumb1.LoadStamp = true;
     LEADThumb1.Resample = true;
  
  LEADThumb1.IncludeSubDirectories = false;
  
     LEADThumb1.ExpandMultipage = false;
  
     LEADThumb1.MaxSizeDisk = 0 ;
     LEADThumb1.MaxSizeMem = 4096000 ;
  
        alert(LEADThumb1.BrowseDir("c:\\testHinhPDF"));
       }


      //-->
      </SCRIPT>
        
      <TITLE>LEADTOOLS JavaScript COM Example</TITLE>
     
   </HEAD>
  
   <BODY OnLoad = "Window_OnLoad()">
      <OBJECT CLASSID="clsid:5220cb21-c88d-11cf-b347-00aa00a28331"
        ALIGN="baseline"
         BORDER="0"
         WIDTH="1"
         HEIGHT="1">
         <PARAM NAME="LPKPath" VALUE="http://10.0.0.8:8080/controls/a.lpk">
      </OBJECT><BR>
     
      <OBJECT ID="Raster1" NAME="Raster1"
   CLASSID="CLSID:00140700-B1BA-11CE-ABC6-F5B2E79D9E3F"
   CODEBASE="http://10.0.0.8:8080/controls/Ltr14e.cab">
   <P>Raster1 - This is not supported in web browser.</P>
  </OBJECT><BR>
  
  <OBJECT ID="RasterVR1" NAME="RasterVR1"
   CLASSID="CLSID:00140B9B-B1BA-11CE-ABC6-F5B2E79D9E3F"
   CODEBASE="http://10.0.0.8:8080/controls/Ltrvr14e.cab">
   <P>RasterVR1 - This is not supported in web browser.</P>
  </OBJECT><BR>
  
  <OBJECT ID="RasterIO1" NAME="RasterIO1"
   CLASSID="CLSID:0014070E-B1BA-11CE-ABC6-F5B2E79D9E3F"
   CODEBASE="http://10.0.0.8:8080/controls/Ltrio14e.cab">
   <P>RasterIO1 - This is not supported in web browser.</P>
  </OBJECT><BR>
     
       <OBJECT ID="LEADThumb1" NAME="LEADThumb1"
   CLASSID="CLSID:00140780-B1BA-11CE-ABC6-F5B2E79D9E3F"
   CODEBASE="http://10.0.0.8:8080/controls/Ltrtm14e.cab">
   <P>LEADThumb1 - This is not supported in web browser.</P>
  </OBJECT><BR>
  
   </BODY>
</HTML>

When I run this HTML. It returns "Lead Error: User cancelled the operation". Can you show me where I am wrong.

Thank you very much.

 
#6 Posted : Tuesday, April 25, 2006 5:08:05 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,328

Was thanked: 1 time(s) in 1 post(s)

Hello,

To solve the problem, you need to handle the LEADThumb1_ThumbnailEvent event and set the LEADThumb1.ContinueBrowse to true as follows:
+----------------------------------------------------------------+
...
LEADThumb1.MaxSizeDisk = 0 ;
LEADThumb1.MaxSizeMem = 4096000 ;
LEADThumb1.BrowseDir("c:\\test");    
}
//-->
</SCRIPT>

<SCRIPT LANGUAGE="JavaScript" FOR="LEADThumb1" EVENT="ThumbnailEvent(Bitmap,pszFilename, nStatusCode, nPercent)">
<!--
LEADThumb1.ContinueBrowse = true;
//-->
</SCRIPT>
...
+----------------------------------------------------------------+

Please try the above solution and let me know if this helps.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2020, Yet Another Forum.NET
This page was generated in 0.323 seconds.