The anser would be...

AffineTransform t = new AffineTransform();
...
t.setToScale(dx,dy); // here you set your magnification level ...
if (mode ==1)    to = new AffineTransformOp
                        (t,AffineTransformOp.TYPE_BILINEAR);
else             to = new AffineTransformOp
                        (t,AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
res = to.filter(bi,null);

Hope that helps ...

Micha




> If I have a BufferedImage which has
>
> Height 25 pixels
> Width 5 pixels
>
> And I scale it so that it is displayed as square (25 x 25), how are the
> pixels along the left edge and the right edge of the image determined for
> bilinear interpolation?
>
> In more detail:
>
> To make my tall thin image square, I do this:
>
> g2.scale(5, 1);    // scale by 5 in x, leave y alone
>
> g2.drawImage(myImage, 0, 0, this);
>
> So one column of pixels from the orig buffered image is displayed as 5
> columns of pixels in the scaled image.
>
> I would expect that in the scaled image, the 'middle column' of each 5
> column band would correspond to a single column of the original image.
>
> I would also expect that the four columns of the scaled image between each
> of the 'middle columns' would show values 'between' each of the middle
> columns.
>
> But how would the two columns on the far left and the two columns on the
> far
> right of the scaled image be determined?
>
> Thank you,
>
> Ted Hill
>
>
===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> of the message "signoff JAVA2D-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>

--
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net

--
GMX Tipp:

Machen Sie Ihr Hobby zu Geld bei unserem Partner 1&1!
http://profiseller.de/info/index.php3?ac=OM.PS.PS003K00596T0409a

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to