Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Imagenes en miniatura
Message
General information
Forum:
Visual FoxPro
Category:
ActiveVFP
Miscellaneous
Thread ID:
00810027
Message ID:
00810353
Views:
18
>Gracias por responder.
>Lo que quiero hacer en realidad es mantener algo asi como un album de fotos/imagenes (jpg, bmp, etc) asociadas a una persona en particular. Osea que se puedan ver todas las imagenes asociadas, en miniatura y que al elegirlas se maximice la correspondiente
>
>Muchas gracias

Dante, lo del z00m es bastante sencillo, pon la imagen dentro de un container y pone la propiedad stretch del control de imagen en 1 (Isometric) o 2 (stretch), luego puedes ajustar el tamaño de la imagen dentro del container.

Por ejemplo, si haces
DEFINE CLASS form1 AS form


	DoCreate = .T.
	Caption = "Form1"
	Name = "Form1"


	ADD OBJECT container1 AS container WITH ;
		Top = 44, ;
		Left = 100, ;
		Width = 137, ;
		Height = 130, ;
		Name = "Container1"


	ADD OBJECT form1.container1.image1 AS image WITH ;
		Picture = "c:\program files\microsoft visual foxpro 8\fox.bmp", ;
		Stretch = 1, ;
		Height = 33, ;
		Left = 8, ;
		Top = 8, ;
		Width = 32, ;
		Name = "Image1"


	PROCEDURE Resize
		thisform.refresh
	ENDPROC


	PROCEDURE container1.Refresh
		with this
			.Top	= 0
			.Left	= 0
			.Width	= .Parent.Width
			.Height	= .Parent.Height
			with .Image1
				.Top	= 1
				.Left	= 1
				.Width	= .Parent.Width - 2
				.Height	= .Parent.Height - 2
			endwith
		endwith
	ENDPROC


ENDDEFINE
Tienes una imagen que se ajusta siempre al tamaño del form

O, por ejemplo para varios niveles de zoom:
PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN

DEFINE CLASS form1 AS form


	DoCreate = .T.
	Caption = "Form1"
	zoomfactor = 1
	Name = "Form1"
	originalsize = .F.


	ADD OBJECT container1 AS container WITH ;
		Top = 30, ;
		Left = 87, ;
		Width = 208, ;
		Height = 184, ;
		MousePointer = 99, ;
		MouseIcon = "c:\program files\microsoft visual foxpro 8\graphics\cursors\magnify.cur", ;
		Name = "Container1"


	ADD OBJECT form1.container1.image1 AS image WITH ;
		Picture = "c:\program files\microsoft visual foxpro 8\fox.bmp", ;
		Stretch = 1, ;
		Height = 33, ;
		Left = 8, ;
		MousePointer = 99, ;
		MouseIcon = "c:\program files\microsoft visual foxpro 8\graphics\cursors\magnify.cur", ;
		Top = 8, ;
		Width = 32, ;
		Name = "Image1"


	ADD OBJECT label1 AS label WITH ;
		AutoSize = .T., ;
		Caption = "Zoom To", ;
		Height = 17, ;
		Left = 213, ;
		Top = 222, ;
		Width = 51, ;
		Name = "Label1"


	ADD OBJECT combo1 AS combobox WITH ;
		Height = 24, ;
		Left = 272, ;
		Style = 2, ;
		Top = 219, ;
		Width = 100, ;
		Name = "Combo1"


	ADD OBJECT text1 AS textbox WITH ;
		ControlSource = "thisform.zoomfactor", ;
		Enabled = .F., ;
		Height = 23, ;
		Left = 87, ;
		Top = 221, ;
		Width = 53, ;
		DisabledForeColor = RGB(0,0,255), ;
		Name = "Text1"


	ADD OBJECT label2 AS label WITH ;
		AutoSize = .T., ;
		Caption = "Zoom Factor", ;
		Height = 17, ;
		Left = 5, ;
		Top = 225, ;
		Width = 71, ;
		Name = "Label2"


	PROCEDURE Init
		thisform.OriginalSize = newobject('Empty')
		addproperty(thisform.OriginalSize, 'Width', thisform.container1.image1.width)
		addproperty(thisform.OriginalSize, 'Height', thisform.container1.image1.Height)

		bindevent(thisform.container1.image1, 'Click', thisform.container1, 'Click')
		bindevent(thisform.container1.image1, 'RightClick', thisform.container1, 'RightClick')
	ENDPROC


	PROCEDURE container1.RightClick
		thisform.ZoomFactor = thisform.ZoomFactor * 0.9
		this.Refresh()
	ENDPROC


	PROCEDURE container1.Click
		thisform.ZoomFactor = thisform.ZoomFactor * 1.1
		this.Refresh()
	ENDPROC


	PROCEDURE container1.Refresh
		with this.image1
			.width = thisform.OriginalSize.width * thisform.zoomfactor
			.height = thisform.OriginalSize.height * thisform.zoomfactor
			.left = (this.width - .width) / 2
			.top = (this.Height - .height) / 2
			this.Parent.text1.Refresh()
		endwith
	ENDPROC


	PROCEDURE combo1.Init
		for i = 10 to 200 step 10
			this.AddItem(alltrim(str(i))+'%')
		next i
		for i=250 to 1000 step 50
			this.AddItem(alltrim(str(i))+'%')
		next i
		this.ListIndex=10
	ENDPROC


	PROCEDURE combo1.InteractiveChange
		thisform.zoomfactor = val(this.Value)/100
		thisform.Refresh()
	ENDPROC


ENDDEFINE
HTH
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform