[Gvsig_english] Code Question - raster layers

Aldo Stracquadanio aldo.strac at gmail.com
Wed Sep 16 13:00:18 CEST 2009


Hi Juan,

I know about the limitation of 400k pixels, I will send you the
exported project I'm working on as soon as I will be in my office. The
problem with resampling of the image is that a
clipping-translating-composition can't resolve the rotation part of a
generic affine transform (and I think in my image it's needed a little
rotation too).

Moreover I see that you use the getScaledInstance method to get a
scaled instance of the image and immediatly after this you check for
width. This often gives me -1 (causing an exception) because this
method (like the most of the graphics methods of CDC) can exibit an
asynchronus behavior; have you ever had such problems?

Regards,
Aldo Stracquadanio.

2009/9/15 Juan Lucas Dominguez Rubio <jldominguez at prodevelop.es>:
> Hello, Aldo.
>
> As you say, the Graphics2D class in CDC knows nothing about affine
> transforms, so you always have to provide 'final' coordinates, that is,
> screen coordinates.
>
> The Image class has a resample method and of course there are ways to clip
> an image, so all you have to do is clipping and resizing the image until you
> have the final image, and then paste it in the correct coordinates on the
> screen, that's what the WKRasterDriver does.
>
> These images (we're talking about JPG, PNG and GIF images; the ECW driver is
> totally different) are very memory-consuming and can only be loaded if the
> have less than 400,000 pixels. If we tried to open larger images, the
> virtual machine itself would be at risk.
>
> We tried to do the clipping and resampling in such a way that we never need
> to instantiate a large image, but maybe this is not always possible.
>
> Can you send us the log files under \gvSIGMobile\log\ or even the image
> itself?
>
>
> Regards,
> Juan Lucas Domínguez Rubio
> ---
> Prodevelop SL, Valencia (España)
> 0° 22' 49.62" W, 39° 28' 25.45" N
> Tlf.: 96.351.06.12 -- Fax: 96.351.09.68
> http://www.prodevelop.es
> ---
>
>
>
> -----Mensaje original-----
> De: gvsig_internacional-bounces at listserv.gva.es en nombre de Aldo
> Stracquadanio
> Enviado el: mar 15/09/2009 18:32
> Para: gvsig_internacional at listserv.gva.es
> Asunto: [Gvsig_english] Code Question - raster layers
>
> Hi everybody,
>
> I'm reading the phoneME Mobile source code, but I can't understand
> something about the WKFRasterDriver: if there is no support for
> AffineTransform in CDC, how do you obtain a "shear" effect using only
> scaling-translation operations? I can't figure it out and, as well,
> the raster layer visualization is not working at all on my
> installation: in my opinion there is some problem with the asynchronus
> behaviour of the Image.getScaledInstance method since I get a "Cannot
> resample (down)".
>
> Can someone help me understanding?
> Thank's all, Aldo Stracquadanio.
> _______________________________________________
> Gvsig_internacional mailing list
> Gvsig_internacional at listserv.gva.es
> http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional
>
>
> _______________________________________________
> Gvsig_internacional mailing list
> Gvsig_internacional at listserv.gva.es
> http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional
>
>


More information about the Gvsig_internacional mailing list