Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Yousfi Benameur
  Where is Yousfi Benameur?
 El Bayadh
 Algeria
 Yousfi Benameur
 To: vaishali maske
  Where is vaishali maske?
 mumbai
 India
 vaishali maske
 Tags
Subject: RE: saving scientific structures
Thread ID: 209658 Message ID: 209687 # Views: 1 # Ratings: 0
Version: Visual FoxPro 8 Category: Databases, Tables and SQL Server
Date: Tuesday, December 30, 2008 1:40:37 PM         
   


> Hi,
>
> I need to save some scientific structure in my data.Those structure must shown in image control.Tell me for saving structures in dbf which data type i should use.there were more then 60000 structures all the structures must shown in image control.
>
> Thanks,
> vaishali

You can stay the images there where it is (for saving places),i prefer in one folder.
this code below searches all images in folder(and its subfoders if exist) and create a cursor to list it+a viewer on each image.
*Yousfi Benameur
*-- Time Stamp:   10/24/08 07:12:11 PM
*scan for all images in a directory and its subdirectories -(bmp,jpg,gif,tiff,png,emf,wmf......can more...)

yform=CreateObject("Yimages")
yform.show
read events
return

DEFINE CLASS Yimages AS form
	Top = 3
	Left = 106
	Height = 389
	Width = 846
	ShowWindow = 2
	DoCreate = .T.
	BorderStyle = 2
	Caption = "Images viewer for all images (BP,JPG,GIF,PNG,TIFF,EMF,WMF...)   -VFP9-    B.Yousfi"
	Name = "form1"

	ADD OBJECT command2 AS commandbutton WITH ;
		Top = 12, ;
		Left = 24, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "Select Dir", ;
		Name = "Command2"

	ADD OBJECT image1 AS image WITH ;
		Stretch = 2, ;
		Height = 372, ;
		Left = 396, ;
		Top = 12, ;
		Width = 432, ;
		Name = "Image1"

	ADD OBJECT list1 AS listbox WITH ;
		FontSize = 8, ;
		RowSourceType = 6, ;
		RowSource = "", ;
		Height = 288, ;
		Left = 5, ;
		Top = 96, ;
		Width = 384, ;
		ItemTips = .T., ;
		Name = "List1"

	ADD OBJECT label1 AS label WITH ;
		AutoSize = .F., ;
		WordWrap = .T., ;
		BackStyle = 0, ;
		Caption = "", ;
		Height = 60, ;
		Left = 120, ;
		Top = 12, ;
		Width = 252, ;
		Name = "Label1"


	PROCEDURE yrecursefolder
		lparameters lcDir 

		local i,n, laFiles[1]
		nrep=nrep+1
		n = adir( laFiles, lcDir + "*.*", "shd" )
		for i = 1 to n
		   if ( left( laFiles[i,1], 1 ) != '.' )
		      if ( "D" $ laFiles[i,5] )
		      thisform.yRecurseFolder( lcDir + laFiles[i,1] + "\" )
		      else
		      if  lower(justext(laFiles[i,1])) $ "bmpjpggifpngtiffemfwmf"     &&images seulement evt d'autres extensions..
		      
		        insert into ycurs values( lcDir ,justfname(laFiles[i,1]), laFiles[i,2], laFiles[i,3] )
		        endi
		      endif
		   endif
		endfor
	ENDPROC


	PROCEDURE Init
		this.maxbutton=.f.
		this.list1.clear
	ENDPROC

	PROCEDURE command2.Click
		thisform.list1.clear
		*************************************
		&&Lister dans un curseur toutes les images d'un répertoire yc les sous répertoires.+nbre+temps calcul.
		yrep=addbs(getdir())
		if empty(yrep)
		return
		endi
		nrep=0
		ltStart = datetime()
		create cursor ycurs (cdir c(150), cFilename c(80), nSize n(10), dMod d )
		thisform.yRecurseFolder( yrep )
		thisform.label1.caption=allt(yrep)+chr(13)+trans(reccount())+" files   "+trans( datetime() - ltStart)+" sec répertoires="+trans(nrep)
		index on nSize tag nSize
		*browse nowait
		thisform.list1.rowsource="ycurs.cfilename"
		thisform.list1.listindex=1
		thisform.list1.refresh
		thisform.list1.click
	ENDPROC

	PROCEDURE list1.Click
		thisform.image1.picture=addbs(cdir)+this.value
	ENDPROC
	
    PROCEDURE DESTROY
    clea events
    ENDPROC

ENDDEFINE


if you move the images move your folder+viewer or put it in same folder.
NB:Can resize form for showing the image in fullscreen.
Regards

ENTIRE THREAD

saving scientific structures Posted by vaishali maske @ 12/30/2008 10:11:29 AM
RE: saving scientific structures Posted by Stefan Wuebbe @ 12/30/2008 10:29:58 AM
RE: saving scientific structures Posted by Yousfi Benameur @ 12/30/2008 1:40:37 PM
RE: saving scientific structures Posted by Cetin Basoz @ 12/30/2008 2:18:18 PM