Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: mike Demosthenous
  Where is mike Demosthenous?
 Nicosia
 Cyprus
 mike Demosthenous
 To: Dale Dedoroy
  Where is Dale Dedoroy?
 Bacolod City, Negros Occidental
 Philippines
 Dale Dedoroy
 Tags
Subject: RE: Word thumbnails
Thread ID: 22407 Message ID: 22658 # Views: 3 # Ratings: 0
Version: Visual FoxPro 7 Category: Forms
Date: Wednesday, April 23, 2003 1:56:13 PM         
   


> > Hi to all.
> > In ms word there is an option where the user can click on a thumbnail of a documant and view it on the right hand site of the screen.
> > There was an article about this matter in the articles section but it creates a temp cursor for its purpose and also it views the documant as bitmaps.
> > So, the big question apart from the obvious (how can this be done in vfp?) is :
> > How can we avoid using general fiels for storing the file?
> > Any help will be appreciared.
> > Thnking you in advance.
> > Regards
> > Mike
>
> Hi Mike,
>
> I presented two articles about this. The first one, (Thumbnails, Anyone - Part I) is about multiple-page graphic format like TIFF. In this article I used Kodak Imaging controls. Sad to say, Microsoft ceased bundling Kodak Imaging since the release of XP. You can still use Kodak Imaging in XP by two means: 1) you now have to buy it and install it in your XP, 2) Copy Kodak files from the other Windows to XP. I posted the procedure sometime ago so just search the forum keyword "Kodak". However, some guys may cry "foul" over the copying issue.
>
> Second article demonstrated the use of VFP's native grid that employed a cursor (a temporary one) with a general field. That's my presentation is all about. I'ts not bad at all to use general field if you only use it temporarily. But of course, if you want to load the entire thousands of records into a general field, it is a big issue.
>
> Here's a workaround. But take note, this is not a 100% fool-proof.
>
> 1. Create a form
> 2. Drop a grid into the form and change it's columncount to 2. Adjust the row height and the width of the first column accordingly to accommodate an image control.
> 3. In the form's load event, add the following lines:
>
> Create Cursor cursthumb (cpath c(120),crandomname c(10))
>
> 4. Populate CursThumb's cPath with the path of your images. For example;
>
> Select CursThumb
> Append Blank
> Replace cPath With "C:\Images\logo.BMP"
>
> If you adopt a convention of naming your image files, filling up cPath will be easier. For example, all file names start with 'image' plus an incremental suffix like image1.bmp, image2.bmp, image3.bmp... image101.bmp, image102.bmp... hope you get my drift. This way you can place codes in a loop with the help of macro substitution.
>
> 5. Place the following codes in the form's Init event:
>
> Select CursThmb
> Scan
> replace cRandomName With sys(2015)
> ** the next line adds an image object in column1. If you are loading a large volume of images, the max number of objects a container can
> ** have may be reached eventually and VFP may generate an error.
> thisform.grid1.column1.addobject('image' + cRandomName,'image')
> loobject = 'thisform.grid1.column1.image' + cRandomName
> loobject = &loobject
> loobject.picture = allt(cPath)
> loobject.stretch = 2
> endscan
>
> With thisform.grid1
> with .column1
> .sparse = .f.
> .dynamiccurrentcontrol = ["image" + CursThumb.cRandomName]
> endwith
> .column2.controlsource = 'cursthumb.cpath'
> endwith
>
> 6. Run the form and goodluck.
>
> Dale
>
>
> "Man's mind once stretched by a new idea never regains its original dimension."



Hi Dale
Thanks for the efford. i read both your articles and i got some ideas.
Thanks again
Regards
MIke

COMPLETE THREAD

Word thumbnails Posted by mike Demosthenous @ 4/17/2003 11:29:33 AM
RE: Word thumbnails Posted by Dale Dedoroy @ 4/20/2003 12:05:11 PM
RE: Word thumbnails Posted by mike Demosthenous @ 4/23/2003 1:56:13 PM