Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Moose Taylor
  Where is Moose Taylor?
 Oxford
 United Kingdom
 Moose Taylor
 To: a.sabato a.sabato
  Where is a.sabato a.sabato?
 mp
 Italy
 a.sabato a.sabato
 Tags
Subject: RE: TO SHOW PREVIEW PICTURE WITH BROWSER
Thread ID: 33642 Message ID: 33733 # Views: 1 # Ratings: 0
Version: Visual FoxPro 8 Category: Classes and Objects
Date: Tuesday, December 02, 2003 5:25:45 PM         
   


I had a look at this and came up with the following program.

If anyone want to 'tart this up' feel free.

Just call it from the command line.. imagePreview([c:\myImageFile.bmp])
If you don't pass the filename, the program gets one using GetPict()

Have fun
Moose

John Taylor MCP
(You can't polish a turd)

'**********************************
*!* Image Preview
*!* John Taylor Dec 2003 (Moose)
*!*
'**********************************
Lparameters LcImage

If Vartype(LcImage)<>"C" OR EMPTY(lcImage)
LcImage = GETPICT()
Endif
lcOK = ''

frmInput = .null.
frmInput = Createobject("Form")
frmInput.Icon = _screen.Icon
frmInput.Width = 600
frmInput.AutoCenter =.T.
frmInput.BorderStyle = 1
frmInput.ControlBox = .F.
&& Form caption
frmInput.Caption = "Image Preview of " + JUSTFNAME(lcImage)
&& Textbox caption
frmInput.AddObject("lblCapt","lblCaption")
WITH frmInput.lblCapt
.Caption = lcImage
.Left = 10
.AutoSize = .T.
.Top = 10
.Height = 25
.Visible = .T. && Show testbox on form
ENDWITH


&& Image
frmInput.AddObject("myImg","myImage")
WITH frmInput.myImg
.Picture = (lcImage)
.Left = 10
.Top = frmInput.lblCapt.Top + frmInput.lblCapt.Height + 10
.Visible = .T. && Show Image on form
ENDWITH


frmInput.AddObject("cmdOK","cmdOKButton")
WITH frmInput.cmdOK
.Caption = "\<OK"
.Left = 10
.Top = frmInput.myImg.Top + frmInput.myImg.Height + 10
.Height = 24
.Visible = .T. && Show button on form
ENDWITH

frmInput.Height = frmInput.cmdOk.Top + frmInput.cmdOk.Height + 10

lnWidth = frmInput.lblCapt.width
IF frmInput.myImg.width > lnWidth then
lnWidth = frmInput.myImg.width
ENDIF
frmInput.Width = 20 + lnWidth
frmInput.Show && Display the form
LcImage = ""
READ EVENTS && Start event processing

If lcOK = 'OK'
frmInput = .null.
Return .T.
Endif

******************************************************************
&& Caption for the form
Define Class lblCaption As Label

ENDDEFINE
******************************************************************
&& The Image for the form
Define Class myImage As Image

ENDDEFINE

******************************************************************
&& OK Button
Define Class cmdOKButton As CommandButton
Procedure Click
lcOK = 'OK'
Clear Events && Stop event processing, close Form
Enddefine


ENTIRE THREAD

TO SHOW PREVIEW PICTURE WITH BROWSER Posted by a.sabato a.sabato @ 12/1/2003 11:35:46 AM
RE: TO SHOW PREVIEW PICTURE WITH BROWSER Posted by Moose Taylor @ 12/2/2003 5:25:45 PM