- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I often use the routine SAVEIMAGE to save an entire window image to a file. When printing that image, or inserting it into a Word document etc., black lines always appear along the right and bottom edges. I have figured out why and how to fix it.
If the window size is, say, NXPIXELS x NYPIXELS, and code is for example
[fortran]
NXPIXELS = 800
NXPIXELS = 600
I4 = SAVEIMAGE (FILENAME, 0,0, NXPIXELS, NYPIXELS)
[/fortran]
you will find that the resulting image is actually 801 x 601, and the extra pixels at the right and bottom are black! The problem can be fixed by
[fortran]
I4 = SAVEIMAGE (FILENAME, 0,0, NXPIXELS-1, NYPIXELS-1) [/fortran]
In defence of Intel, the documentation is a little nebulous about the arguments defining a "bounding rectangle" around the desired part of the window image, but in my opinion this is a bug and should be fixed--or at least include a warning about what happens when you try to save an entire window. (I have not investigated what happens when you save a portion of a window, or use 1,1 as the upper left corner instead of 0,0.)
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
On reflection, I'm not sure I can blame Intel's documentation at all. I note that when a window is created, you specify NUMXPIXELS, NUMYPIXELS. The address of the upper left corner is (0, 0) and the address of the lower right corner is (NUMXPIXELS-1, NUMYPIXELS-1). So when you ask to save an image as I did above, you are actually asking for a size of 801 x 601. What else can the compiler do but make the extra pixels black? So the proper statement is
I4 = SAVEIMAGE (FILENAME, 0,0, NXPIXELS-1, NYPIXELS-1)
and this is simply the prudent thing to do. I only wish that the documentation for SAVEIMAGE explained this a bit. An example would be good.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page