Java Reference
In-Depth Information
be negative (
580)
therefore denotes the lower left corner of the displayed image which is the
upper left corner of the original.
100). Similar to (C) this swaps up and down. Position (10
,
(F) Draws an enlarged copy of a part of the original image. The first four numerical
parameters 420, 420, 580, 580 specify the upper left and lower right corners of
the target rectangle in the panel. This area is 160
×
160 pixels. The following
four parameters 250, 130, 290, 170 determine a 40
20 source rectangle in
the original image. Note that these coordinates refer to the original 400
×
400
picture in the Image variable, not to the displayed one in the panel. The source
×
!
has to be horizontally stretched by a factor of four and vertically by a factor of
eight to fit into the target area.
(G) To indicate the source for (F) area, a white rectangle is drawn in the panel.
The result is shown in Figure 15.4.
Figure 15.4 Application ImageCutAndMirrorFrame .Top left: original size picture. Lower
right: enlarged images of the area in the white rectangle. Lower left and top right: the original
image shrunk and reflected
Search WWH ::




Custom Search