[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.tools] Re: Here is what we are trying to do...
|
While it would be nice for GC to support scaling directly, I think your only
option
now is to permit some error in the choice of tile sizes and offsets. If the
source
image is vastly larger than the target, the difference should not be
perceptible.
[Nevermind that GC does coarse scaling, not smooth scaling right now and it
introduces its own margins of error however small they may be].
Alternately, why not consider direct sampling. If you use the GC function
as
it is now, then there is a one to one mapping between the points of the
thumbnail
and the points of the original image if the image is larger than the
thumbnail
in both width and height. This is because we sample one pixel of the source
rather than accumulating the contribution of all pixels in a region when
painting a destination pixel. You could achieve the same result by sampling
your
diagram and building your thumbnail pixel by pixel.
Jeff.
"Randy Hudson" <none@xxxxxxx> wrote in message
news:9k6vb3$q6$1@xxxxxxxxxxxxxxxx
> Suppose the drawing is 10,000 x 10,000 pixels, and the Thumbnail is 67 x
67?
> Where would I place the first 1000 x 1000 tile? There is no way to
preserve
> the scale factor of .0067 unless you could do:
>
> gc.drawImage ( buffer, 0,0,1000,1000, 0, 0, 6.7, 6.7);
>
> That is the problem with tiling. We can't place the tiles in the correct
> place on the thumbnail.
>
> "Nick Edgar" <nick_edgar@xxxxxxx> wrote in message
> news:9k6eb1$qst$1@xxxxxxxxxxxxxxxx
> > I see the problem. About the only thing I could suggest is tiling the
> large
> > image, eg. into 1000x1000 chunks, and blitting them down to your
thumbnail
> > one at a time (it would be best to reuse the tile image rather than
> > recreating it). But you'd have to be careful about overlaps.
> > Maybe you calculate the maximum area within your thumbnail corresponding
> to
> > an area in the whole drawing which is less than some reasonable limit.
So
> > you'd always be scaling down to an integral number of pixels in the
> > thumbnail.
> >
> >
> >
>
>