The Swing Sample
This sample demonstrates using Java Swing classes. It demonstrates several image methods, such as altering the viewable size, changing the orientation, modifying the size and resolution, making corrections, and converting to other formats. You can find the samples in the \samples\swing
directory.
For instructions on running this sample, please see the instructions to Run RasterMaster samples in your IDE or to Run samples from the Command Prompt in the Overview.
Listed below are the methods used in this sample:
IMG_decompress_bitmap(String, int)
reads in a document in any format and converts it to a valid RasterMaster image.IMG_deskew_bitmap(int)
is a fast rotate for 1-bit skewed images.IMG_despeckle_bitmap(int)
removes noise (random pixel data) from 1-bit images.IMG_display_bitmap(java.awt.Graphics, int, int, int, int)
displays the current image at the current X and Y coordinates and is not corrected for aspect ratio.IMG_display_bitmap_aspect(java.awt.Graphics,java.awt.Container, int, int, int, int, int)
displays the current image, corrected for aspect ratio, at the current X and Y coordinates.IMG_erase_rect(int, int, int, int, int, int, int)
fills the inside or outside of the specified rectangle (xs, ys, xsize, andy size parameters) with the color passed in. It can be used to remove borders, for instance.IMG_flip_bitmapx(void)
flips the image horizontally to produce a mirror image.IMG_flip_bitmapy(void)
flips the image vertically to produce a mirror image.IMG_get_deskew_angle(int[], int, int)
returns the skew angle for 1-bit images.IMG_invert_bitmap(void)
inverts the current image, changing pixels by a simple XOR operation applied to each byte of the image in memory.IMG_merge_block(Snow.Snowbnd, int, int, int)
draws a source image on top of the current image at the x and y coordinates (xpos and ypos) passed in.IMG_print_applet(java.awt.Container, int)
prints images loaded in to an applet.IMG_resize_bitmap(int, int)
resizes the image.IMG_rotate_bitmap(int)
rotates the current image clockwise by display angle.IMG_save_bitmap(byte, int)
saves the current Snowbnd image object to a byte array.IMG_window_level(int, int, int)
changes the range of displayed pixels. It performs window leveling in 8 and 16-bit grayscale images.Snowbnd()
Have questions, corrections, or concerns about this topic? Please let us know!