E
Erik Veenstra
Is it possible to simulate a mouse drag event in a browser (or
any program in general) with Ruby? Something like:
dragmouse(x1, y1, x2, y2)
or
dragmouse("windowname", x1, y1, x2, y2)
Either Windows or Linux (Xfree86).
Why? On the 'Net, there are a lot of sites which offer maps.
You can scroll these maps by dragging the image, virtually
flying over the map. You can look at such a map as one very,
very big image, of which you see only one part at a time.
Collecting these parts gives us little overlapping maps of a
certain region. These overlapping maps can be converted to
non-overlapping maps by cropping and saving with ImageMagick.
The resulting "tiles" are zipped in a file, which can be
handled with TIV (Tiled Image Viewer).
This is no theory, it actually works. I've made TIV in Ewe [1]
(kind of Java...). It runs on Windows (natively, fast), Linux
(Java, slow) and on my iPAQ (natively, fast enough). I did the
conversion from the overlapping maps to the non-overlapping
maps with ImageMagick. Not difficult, but it takes some
processing time. Saving the screenshot can be done with
"import" (part of ImageMagick). I glued everything together
with Ruby, of course.
I once got the images by hacking the URL's of one of those
sites, but they changed it... Grabbing the images by taking
screenshots is much better, because it works for every
"vendor"... The only missing part is the programmatically
dragging of the images in the browser.
Anybody able to help? Other ideas? (Except "buying" a
product...)
gegroet,
Erik V. - http://www.erikveen.dds.nl/
[1] http://www.ewesoft.com/
any program in general) with Ruby? Something like:
dragmouse(x1, y1, x2, y2)
or
dragmouse("windowname", x1, y1, x2, y2)
Either Windows or Linux (Xfree86).
Why? On the 'Net, there are a lot of sites which offer maps.
You can scroll these maps by dragging the image, virtually
flying over the map. You can look at such a map as one very,
very big image, of which you see only one part at a time.
Collecting these parts gives us little overlapping maps of a
certain region. These overlapping maps can be converted to
non-overlapping maps by cropping and saving with ImageMagick.
The resulting "tiles" are zipped in a file, which can be
handled with TIV (Tiled Image Viewer).
This is no theory, it actually works. I've made TIV in Ewe [1]
(kind of Java...). It runs on Windows (natively, fast), Linux
(Java, slow) and on my iPAQ (natively, fast enough). I did the
conversion from the overlapping maps to the non-overlapping
maps with ImageMagick. Not difficult, but it takes some
processing time. Saving the screenshot can be done with
"import" (part of ImageMagick). I glued everything together
with Ruby, of course.
I once got the images by hacking the URL's of one of those
sites, but they changed it... Grabbing the images by taking
screenshots is much better, because it works for every
"vendor"... The only missing part is the programmatically
dragging of the images in the browser.
Anybody able to help? Other ideas? (Except "buying" a
product...)
gegroet,
Erik V. - http://www.erikveen.dds.nl/
[1] http://www.ewesoft.com/