Background of the Invention
1. Field of the Invention
The present invention relates to a system for displaying a stored image within a display window of an already-displayed image such that the stored image may be easily scrolled. More particularly, the present invention concerns an image scrolling system which scrolls a stored image in a display window by 1) retrieving a portion of the stored image from a memory, 2) copying the portion to a video random access memory (VRAM) area, 3) displaying the portion in a display window corresponding to the VRAM area and 4) repeating steps 1) to 3) in response to operator-generated scrolling instructions.
2. Description of the Related Art
Conventional display systems are capable of scrolling an image in a window of a display screen. However, these systems must perform several complex steps to effect such scrolling. For example, applications written for the Microsoft Windows operating system scroll an image in a window by first moving still-visible portions of the image to their new position in the window. Next, the operating system issues a "paint" command instructing the application to redraw invalidated regions so as to fill any empty space in the window. The empty space is redrawn with second portions of the image such that the image appears to scroll in the window. Due to the complexity of these required steps, any scrolling performed by these conventional display systems is both time-consuming and computing-intensive.
Accordingly, what is needed is a display system for scrolling an image in a display window which reduces both computing time and VRAM.
Summary of the Invention
The present invention addresses the foregoing by providing a display system which scrolls an image stored in a memory by first drawing the scrollable image in a memory and then, in response to desired scrolling operations, simply transferring an appropriate portion of the image from the memory to VRAM.
Thus, according to one aspect of the invention, a first image is scrolled inside a window of a second image displayed on a display screen by storing the second image in a VRAM, designating an address in the VRAM corresponding to a location of the window on the display screen, storing contiguous image information corresponding to the first image in a memory different from the VRAM, defining a pointer corresponding to a portion of the contiguous image information of the first image, copying the portion of contiguous image information from the memory to the VRAM at the designated address in VRAM and displaying the contiguous image information in the window of the second image. User interface commands are accepted to scroll the first image, and in response to those user interface commands the value of the pointer is changed and the copying from memory and displaying are repeated.
This brief summary has been provided so that the nature of the invention may be understood quickly. A more complete understanding of the invention can be obtained by reference to the following detailed description of the preferred embodiment thereof in connection with the attached drawings.
Brief Description of the Drawings
FIG. 1 is a view showing a preferred embodiment of the present invention.
FIG. 2 is a block diagram showing the internal functional arrangement of the embodiment of FIG. 1.
FIG. 3 is a view of a display screen of a software application embodying the present invention.
FIGS. 4A and 4B are views of an image to be scrolled as stored in a memory according to the present invention.
FIG. 5 is a view for describing a correspondence between VRAM memory areas and display monitor pixel positions according to the present invention.
FIGS. 6A and 6B are two views of a display window and a corresponding view box during scrolling according to the present invention.
FIG. 7 is a flowchart for describing a method for scrolling image data in a display window according to the present invention.
Detailed Description of the Preferred Embodiment
FIG. 1 is a view showing the outward appearance of a representative embodiment of the invention. Shown in FIG. 1 is word-processing system 1 which includes keyboard 2, frame 3, floppy disk drive 4, paper support 5, paper advance roller 6, printing unit 7 and stand-alone display monitor 8.
In the preferred embodiment, word-processing system 1 is a Canon StarWriter Jet 4000, which employs inkjet printing technology and a 14-inch VGA monitor having a resolution of 640.times.480 pixels. Of course, the present invention may be embodied in any system for displaying images.
A user of a word-processing system embodying the present invention uses keyboard 2 to input characters into system 1. These characters may be displayed on display monitor 8, output onto a page via paper support 5, paper advance roller 6 and printing unit 7, or saved to a floppy disk inserted in floppy disk drive 4 for later editing, printing or display. Characters may also be input into system 1 through a floppy disk inserted in floppy disk drive 4.
The internal operation of word-processing system 1 is diagrammed in FIG. 2. As shown in the Figure, word-processing system 1 is controlled by microcontroller 10, which interfaces to motor driver 11 and gate array 13. Motor driver 11, in turn, interfaces to printing unit 7 in order to provide control over printing unit 7. Second motor driver 12 interfaces to printing unit 7 to provide a second means for controlling printing unit 7 and also interfaces to gate array 13. Similarly, gate array 13 interfaces to video interface 14, which controls display monitor 8.
Gate array 13 is also connected to sixteen megabyte read-only memory (ROM) 15, which provides a majority of the instructions necessary to operate system 1, and to one megabyte random access memory (RAM) 16 and one megabyte RAM 17. RAMs 16 and 17 contain the system's standard random access memory (RAM) 9 and video random access memory (VRAM) 19. It should be noted that any data stored in VRAM 19 is displayed on display monitor 8 each time monitor 8 is refreshed.
Alternatively, VRAM 19 may be included separately from RAM 9. For example, VRAM 19 may be included within interface 14 so that data within VRAM 19 can be accessed by interface 14 without needing to travel through gate array 13.
Keyboard 2 is connected to gate array 13 and thereby allows a user to input commands and/or text into system 1 so as to perform word-processing tasks. Floppy disk controller 18, also connected to gate array 13, controls floppy disk drive 4 in order to obtain data from or save data to a floppy disk. For example, floppy disk controller 18 can be used to transfer a software application embodying the present invention from floppy disk drive 4 to RAM 9.
A representative display of a "slot machine" software application embodying the present invention is shown FIG. 3. The display shows background image 20 having three display windows 21 in which images are scrolled. Background image 20 also provides the user with information windows relating to game play, such as amount wagered window 22, total winnings window 23 and amount earned per trial window 24. Background image 20 also contains a slot machine handle 25 which is graphically "pulled" when activated by a user. Once handle 25 is pulled, a scrolling method according to the present invention is invoked.
FIGS. 4A and 4B show two versions of image 26, which is to be scrolled in display windows 21. Image 26 is stored as contiguous image information in RAM 9. While it is preferable to store the image information in RAM 9, so that image contents can be changed, image information may also be stored in ROM 15 when practicing the invention. It should be noted that image 26 is stored such that the first and last stored "frames" 30 of image 26 are identical.
FIG. 4A also shows pointer 29, which defines view box 27. View box 27 circumscribes a portion of contiguous image information of image 26 which is displayed in display window 21. Therefore, pointer 29 corresponds to the portion of contiguous image information of image 26 which is displayed in display window 21. In addition, view box width 28 is equal to the width of image 26.
Image 26 is stored within RAM 9 so as to facilitate manipulation of pointer 29 during the scrolling process, which will be described with respect to FIG. 7. For example, in the case that vertical scrolling is desired, image 26 is stored as a "vertical" data structure, as shown in FIG. 4A, in which the address of a first pixel of a row immediately follows the address of the last pixel of the preceding row.
FIG. 4B shows stored image 26 in the case that horizontal scrolling is desired. In particular, the rows of each scrolled "frame" of image 26 are addressed sequentially, with the last address of a row of the last "frame" immediately preceding the first address of the next row of the first "frame". FIG. 4B also shows pointers 29 and 29A, which respectively point to view box 27 and view box 27A.
FIG. 5 depicts VRAM memory map 31, in correspondence with display 20. In the present invention, monitor 8 is a black-and-white monitor. Accordingly, only one bit is needed to store the ON/OFF state of each pixel of monitor 8. Accordingly, each bit stored in VRAM 19 corresponds to a pixel on display monitor 8. If a bit in VRAM 19 is set high, the corresponding pixel on monitor 8 is activated. As shown in FIG. 5, VRAM 19 contains memory addresses 32 corresponding to each display window 21 of background image 20. Therefore, any data written to an address located within one of memory addresses 32 appears at a corresponding position in corresponding display window 21. Of course, other VRAM-to-monitor memory maps may be used, such as 24-bits of VRAM for each monitor pixel in a case where 24-bit color is in use.
FIG. 6A is a view of one of display windows 21 and image 26 during a scrolling method according to the present invention. Pointer 29 points to view box 27, which circumscribes a portion of contiguous image information of image 26. During scrolling, the contiguous information circumscribed by view box 27 is transferred to one of VRAM memory addresses 32. Accordingly, the portion of image 26 circumscribed by view box 27 of FIG. 6A is shown in display window 21. FIG. 6B shows a similar view, except that view box 27 and display window 21 contain a different portion of image 26 than that shown in FIG. 6A.
FIG. 7 is a flowchart illustrating the method of the present invention. In response to user interaction which causes a simulated pull of handle 25, the method of the present invention begins scrolling image 26 within display windows 21. However, for the sake of clarity, the method of the present invention will be described with respect to scrolling image 26 in one of display windows 21.
In this regard, pointer 29 initially points to a currently displayed portion of image 26 in step S10. As shown in FIG. 4A, this portion of image 26 is circumscribed by view box 27 and begins at a leftmost edge of image 26.
Next, in step S1, view box 27 is examined to determine whether it has reached an end row of image 26. For example, if downward scrolling is being performed, view box 27 is examined to determine whether it contains the first row of image 26. If so, pointer 29 has reached the top of image 26 and pointer 29 must be updated in step S12 to continue scrolling. If not, flow proceeds to step S13.
In step S12, pointer 29 is updated so as to point to the first row of the last "frame" 30 of image 26. Since first and last "frames" 30 of image 26 are identical, view box 27 circumscribes identical contiguous portions of image 26 before and after step S12. This method insures that image 26 scrolls smoothly in display window 21. Flow then proceeds to step S13.
As an alternative to steps S11 and S12, pointer 29 may define view box 27 such that view box 27 circumscribes several rows of image 26 at both the top and bottom of the "vertical" data structure of image 26. This "wrap-around" feature enables the present invention to scroll image 26 without performing steps S11 and S12. In addition, this alternative does not require first and last "frames" 30 to be identical.
Returning to the flow at step S13, the portion of image 26 within view box 27 is copied to VRAM address 32 which corresponds to display window 21 in which image 26 is to be scrolled. Accordingly, the portion of image 26 within view box 27 is the same size as VRAM area 32.
As mentioned above, any data present in VRAM 19 is displayed on display monitor 8 each time monitor 8 is refreshed. Therefore, in step S14, the portion of image 26 copied to VRAM 19 in step S13 is displayed in display window 21.
In step S15, pointer 29 is updated in accordance with the desired scrolling effect. For example, to scroll downward, pointer 29 is decremented by a value equal to view box width 28. As a result, the portion of image 26 within view box 27 loses its lowest line and gains a new uppermost line. Therefore, once the updated portion of image 26 stored in view box 27 is displayed in step S14, the previously displayed portion appears to have scrolled downward. Flow continues in this manner, resulting in the desired downward scrolling effect.
Similarly, in order for image 26 to scroll upward, the address pointer is incremented by the width of view box 27 in step S15. Either downward or upward scrolling can be accelerated by decrementing or incrementing pointer 29 by an integer multiple of view box width 28.
Manipulation of pointer 29 during downward scrolling is illustrated in FIGS. 6A and 6B. These Figures show display window 21 and view box 27 at two different moments during downward scrolling. In FIG. 6A, a portion of contiguous image information within view box 27 is displayed in display window 21. In FIG. 6B, pointer 29 has been decremented by an integer multiple of view box width 28. As a result, the portion of image 26 within view box 27 loses several of its lower lines and gains an identical amount of upper lines. Accordingly, in FIG. 6B, the displayed portion of image 26 shown in FIG. 6A has scrolled downward.
Pointer 29 can also be updated in step S15 so as to cause rightward horizontal scrolling. In this case, pointer 29 is incremented by one. Similarly, pointer 29 is decreased by one if leftward scrolling is desired. As described above with respect to vertical scrolling, horizontal scrolling can be accelerated by incrementing or decrementing pointer 29 by an integer multiple of one.
For example, image 26 is stored as shown in FIG. 4B in the case of horizontal scrolling. To perform rightward scrolling, pointer 29 of FIG. 4B is increased by a multiple of one, resulting in view box 27A. Rightward scrolling is accomplished by displaying the contents of view box 27A after displaying the contents of view box 27.
As mentioned above, in the preferred embodiment, the method described above is followed so as to scroll image 26 in each of display windows 21. However, view boxes corresponding to each display window 21 are initially defined at different locations within image 26 pattern and are updated at different increments, thereby causing unique scrolling within each of display windows 21.
While the present invention is described above with respect to what is currently considered to be the preferred embodiment, it is to be understood that the invention is not limited to the disclosed embodiment. To the contrary, the invention is intended to cover various modifications and equivalent structures included within the spirit and scope of the appended claims.