Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

displaying a picture in window

Status
Not open for further replies.

skrizoo

Programmer
Mar 9, 2001
8
CA
I am trying to easily display a full sized jpg on the screen without much luck.

I have created a demo of an application written in Foxpro 8.0. In the production version, I call up a third party mapping program to display a distribution network in North America. For the demo version, I just want to display a snapshot pic of one of the maps as I can't distribute the mapping program without paying for it.

I call the mapping program from within a form where I set up certain parameters for the map. I have created some code as follows that displays the jpg just as I want it in a window.

DEFINE WINDOW mapdisp from 0,0 TO 50,120 CLOSE GROW ZOOM FILL FILE;
"optinetdem.jpg" TITLE "Mappoint Bread Demo" float
ACTIVATE WINDOW mapdisp

It works fine in development, with the jpg showing up in the development screen. But when I run it as an exe, nothing shows.

Does anyone have any ideas of what I can do to show this jpg. Maybe I shouldn't be using the activate window. Any ideas would be welcome.

Thanx,
Ralph Skrzydlo
 
here is a simple way fo doing it in vfp6:
Code:
PUBLIC oform1

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


**************************************************
*-- Form:         form1 (c:\sampform.scx)
*-- ParentClass:  form
*-- BaseClass:    form
*-- Time Stamp:   03/19/05 08:45:06 AM
*
DEFINE CLASS form1 AS form


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


	ADD OBJECT image1 AS image WITH ;
		Picture = "\avatars\aniguy1.jpg", ;
		Height = 128, ;
		Left = 112, ;
		Top = 47, ;
		Width = 128, ;
		Name = "Image1"


ENDDEFINE
*
*-- EndDefine: form1
**************************************************
or you can visit faq184-2394 for a more flexible version.

hope this helps. peace! [peace]

kilroy [knight]
philippines

"Once a king, always a king. But being a knight is more than enough."
 
I've tried it in my VFP7 with jpg and your way of doing it works fine in an executable. So there is nothing wrong with the command structure (at least not in VFP7). Try it again by giving more info were to find the picture, ex. "C:\Documents\picturename.jpg"

Hope it helps.
Greetings. Peter.
 
Thank you everybody who gave me suggestions. Unfortunately, they didn't solve my problem. I was able to display the form in development mode, whether it was a bmp or a jpg. The problem arose in the exe where it was trying to show the form in the development window which of course did not exist when running the exe.

What I eventually did was to call another form from within the form that normally called the third party software. When a flag in my database was set to "demo", instead of calling the third party software from my controlling form, it called the form that displayed this sample image. This child form had the showwindow property set to "1" so that it would show on top.

It may not be pretty, but it works.

Ralph Skrzydlo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top