Silverfrost Forums

Welcome to our forums

display a .jpg file

23 May 2011 12:07 #8281

Hallo, who can help me, the program stop with 'control is too big for window' in line ...%im....

test.jpg is a simple .jpg file with 770 KB(one page).

Is there a better possibility to display a help-file with F1? Thank you for your help. Johann

winapp 0,0
program jpg
include<windows.ins>
integer*4 i
external help
i=winio@('%ca[jpg]&')
i=winio@('display a jpg file as help with F1 key&')
i=winio@('%ac[F1]',help)
stop
end

integer*4 function help() 
include <windows.ins>
integer*4 i
i=winio@('%im[myimage]')
help=1
end

resources
myimage IMAGE test.jpg


  
          
23 May 2011 2:09 #8282

Hi Bartl,

There is always a better way!

You can create a hypertext help file, and compile it into a file of type .chm (Compiled Hypertext Markup). All windows systems contain the hypertext help display program, HH.EXE. Once you have your CHM file (say BARTL.CHM), you launch it with:

START_PPROCESS@('HH.EXE', 'BARTL.CHM')

You don't need to bother about the path to HH.EXE, because it resides in the standard windows directory.

Most of the compilation into CHM is done by standard downloadable Microsoft programs, but they are ugly and unhelpful in their raw form. There are several free, and many commercial, front-ends to this process. I use a free one called HelpMaker, although the originator (Vizacc) seems to have withdrawn it recently. You would need to find one that you liked. HelpMaker has its issues.

I haven't mastered the options which permit you to launch the CHM file 'open at the right page'. This is possible, but not by me, and involves adding some extra parameters into the character string of the second parameter to START_PPROCESS@.

You could always use HTML ... although when I tried to go down this route, I didn't much like the result. FTN95/Clearwin does have some facilities which relate to the previous Microsoft standard for help files (.HLP) - but then you are developing old technology.

The time that HH.EXE takes to load is appreciable, but then you do get a searchable hypertext system with links to other topics. You can always pop up a standard modal window with an OK close button, several lines of text and small illustrations done as bitmaps.

Regards

Eddie

23 May 2011 8:34 #8283

program works fine.

As to the Help you can use FTN95 own HTML parser, though when i was using it more then 10 year ago it was a bit primitive.

24 May 2011 6:55 #8284

Without detracting from the replies above, if a control is too big for the screen then it needs scroll bars or be displayed in part. ClearWin+ does not automatically provide scroll bars in this context and assumes you want to see the whole.

There may be a direct ClearWin+ solution to the problem (%gr maybe) but, as has been noted above, there are other ways of producing help files.

26 May 2011 12:20 #8301

A very simple way to display a jpg image is to use

imagefile = 'c:\...\test.jpg' call USE_URL@(imagefile)

Regards - Wilfried

27 May 2011 8:35 #8312

Hi, thank you very much for your help, the solution with %im… and USE_URL now works fine. I am also very interested in the solution with hypertext help but have no time in the moment to try it, a first test has failed. Have someone a simple example? Johann

27 May 2011 9:01 #8323

Johann,

Your PC Windows folders will have plenty of CHM files. Copy one of them into your working directory, and you can then start it with HH.EXE from the command prompt. You should be able to start it using START_PPROCESS@ as well. The big problem is getting the path to the chm file right. Here is my routine, which is a callback for a HELP menu item:

      INTEGER FUNCTION IHELPSYS()
C     --------------------------
       CHARACTER*(256) PNAME
       INCLUDE <WINDOWS.INS>
C      -----------------------------------------------------------------
      IHELPSYS = 1
      CALL GET_PROGRAM_NAME@ (PNAME)
      CALL UPCASE@ (PNAME)
      N = LEN_TRIM (PNAME)
      IF (PNAME (N-5:N) .EQ. 'XX.EXE') THEN 
      N = N - 6            ! Assumes XX.EXE
      CALL START_PPROCESS@('HH.EXE',PNAME(1:N)//'XXHelp.chm')
      ELSE
      DO 10 I=1,N
      J = N + 1 - I
      IF (PNAME(J:J) .EQ. '\') GO TO 20
  10  CONTINUE
      RETURN
  20  CALL START_PPROCESS@('HH.EXE',PNAME(1:J)//'XXHelp.chm')
      ENDIF
      END

Not elegant, not foolproof - but finds the CHM file in the folder where the program XX.EXE was installed. Maybe, (and I can't remember) it even finds the path if the program file was renamed!

Now the problem is to create your own CHM. I tracked down Vizacc HelpMaker to www.softpedia.com where it is still available for download. After downloading and installing it, you need to create a project, and compile it. This application can create other help formats as well, but CHM is the one you want. How sophisticated you get with cross references (hyperlinks), keywords, colours, images, fonts etc is up to you.

In principle, you can open this helpfile at any topic you choose, but I have never persevered long enough to find out how.

My routine above assumes that you have installed your application somewhere like C:\Program Files\XX. Installation (or Setup) is an important part of giving your application a professional feel. I also use a freeware program for this called Innosetup (Jordan Russell software), and this puts my CHM files into the same folder as my EXE.

If you want me to send you any example files etc, send me a private message with where to send it...

Eddie

Please login to reply.