[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [udig-devel] GlassPane update
|
Graham Davis wrote:
Hi,
I am still working on a small project to overlay images on a map and
warp them to fit. I am using Emily's new GlassPane "layer" for
drawing the image and manipulating it on.
That may not be the most cool - because the GlassPane is specifically
targeted at SWT "instant feedback" - it is a peer of the existing
DrawCommands (indeed it does not offer any extra abilities of a draw
command).
But I need to work with AWT bufferedImages (not SWT Images) because I
have memory problems with large images otherwise.
That makes some sense. Thinking.
The Advanced SWT graphics mode allows you to set some basic
transformations (affine transformations) that you could use to draw your
same image again and again... but really you probably want to use a
MapGraphic here; actually a combo of...
- draw command for visual feedback for your tool; probably the outline
of the image and all the before/after control points
- mapgraphic to draw the warped image ... it hooks into the existing AWT
Image Stuff
Please note you should probably avoid BufferedImage or you will run out
of memory; especially if the customer is planning to use any large
imagary ... what you need to get is a chain from the image on disk;
through several transformations provided by that warp tool and into a
final PlanarImage that you can draw...
Currently the GlassPane only draws onto a GC (SWT graphics) and not a
Graphics2D (AWT graphics). After a brief discussion with Emily, I am
going to update the GlassPane to have a new property telling it to use
either SWT or AWT for drawing. This will default to SWT so that any
current implementations don't break.
That actually sounds incorrect; the construct already exists and is
called a MapGraphic. Please do not make GlassPane modal ...
I just wanted to see if anyone had objections to this, or see a better
way to go about this. Thanks,
See above; the facilities you need should already be in place.
Did emily every manage to fix MapGraphic on trunk - (ie when tiles are
used we had scalebars being repeated one for each tile).
Jody