G
George Weis
Hi:
I'm trying to write a simple screen enlarger. The basic
algorithm is this:
a.) Get current mouse coordinates.
b.) Take a screen shot using a rectangle consisting of (mouse X,
mouse Y, 150, 150)
c.) Create a new scaled image from the screen shot with a height and
width of 300.
This should "zoom" 2 X for the portion of the screen the mouse cursor
is on and show it in a 300 X 300 box
(the image is drawn on the glass panel on top of the other root
panels).
This doesn't produce the result I want.
The screen shot looks fine if I take the screen shot 350 pixels away
from the current mouse coordinates, in other words (mouse X + 350,
mouse Y + 350, 150, 150).
But, if I try to take the screen shot too close to the current X and
Y, I get double or triple images of the same area in the image.
I can't attach a sample image, but it looks like this, each number
representing one of the images.
1 | 2 | 3 |
| | |
---- | |
| |
-------- --- |
|
--------------------
Anyone know what is causing this behavior? And how to get rid of it?
And by the way, I freely admit I am a newbie, so if anyone knows a
better way to render a zoom of an arbitrary part of a User Frame,
please let me know.
Thanks,
George
I'm trying to write a simple screen enlarger. The basic
algorithm is this:
a.) Get current mouse coordinates.
b.) Take a screen shot using a rectangle consisting of (mouse X,
mouse Y, 150, 150)
c.) Create a new scaled image from the screen shot with a height and
width of 300.
This should "zoom" 2 X for the portion of the screen the mouse cursor
is on and show it in a 300 X 300 box
(the image is drawn on the glass panel on top of the other root
panels).
This doesn't produce the result I want.
The screen shot looks fine if I take the screen shot 350 pixels away
from the current mouse coordinates, in other words (mouse X + 350,
mouse Y + 350, 150, 150).
But, if I try to take the screen shot too close to the current X and
Y, I get double or triple images of the same area in the image.
I can't attach a sample image, but it looks like this, each number
representing one of the images.
1 | 2 | 3 |
| | |
---- | |
| |
-------- --- |
|
--------------------
Anyone know what is causing this behavior? And how to get rid of it?
And by the way, I freely admit I am a newbie, so if anyone knows a
better way to render a zoom of an arbitrary part of a User Frame,
please let me know.
Thanks,
George