2 Replies Latest reply on Sep 6, 2006 8:57 AM by Arggghhhhh

    Image Capture


      I need help on setting the screen resolution to capture images to be published in CHM file. Can anybody help me out on this? Also, please suggest the DPI at which to capture the images. What should be the ideal size of the image in the CHM?

      Thanks in advance
      Anil Hanagud
        • 1. Re: Image Capture
          RoboColum(n) Level 5
          Hi Anil. I don't think you are going to get a definitive answer to this one as it depends on the window size, the image size, whether the image needs resizing, the screen resolution used on the PC where the CHM is viewed and probably lots of other factors. The way I do it is experiment. IMHO there really is no other option than to roll your sleeve up and get dirty.
          • 2. Re: Image Capture
            Couldn't agree more - this all depends on the viewing capability of your target audience. However, you can box a bit clever and display images that are suitable for a given resolution. Javascript could be used to do this.

            First, create several versions of an image - each relevant to a given resolution. remember to keep the first part of the file name identical for each image but specifiy the screen resolution it applies to as a suffix (e.g. "PIC1_1280_1024.gif", "PIC1_1024_768.gif" and so on).

            Next, in RH, create a 'Dummy page' - this is a page that must be included in the output for a project, but does not get added to the TOC or index. On this page, add all pics of all resolutions. This page must be included in your project (including the correct build tags) for the pictures to be carried over into the eventual output.

            Then, select the page(s) where you want to add swappable images. Open the page in TrueCode - and add the following JavaScript statement to your HEADER section (please, no moans about the script - I'm a sloppy coder ok, but this works - in IE anyway):

            <SCRIPT language="javascript">
            function swapPic(PicFileName) {
            var WinHeight = screen.height;
            var WinWidth = screen.width;
            FullFileName = "./Images/" + PicFileName + "_" + WinHeight + "_" + WinWidth + ".gif";
            return FullFileName

            (amend the paths for FullFileName as appropriate)
            Then, wherever you want a clever pic to appear, add the following code to your
            BODY section:

            <SCRIPT language="javascript">
            document.write("<IMG src = '" + swapPic("PIC1") + "'>");

            (in the above example, the base file name is "PIC1" - change it to whatever you are going to use. It will most likely be different for each script block in the BODY section.)

            That's it - you won't be getting any annoying script messages in the compiled CHM as its an offline component (you may get them in the preview mode though).

            Hope this helps someone.