public class BMPFile
extends java.awt.Component
Modifier and Type | Field and Description |
---|---|
private int |
_fOffBits |
private int |
_fReserved1 |
private int |
_fReserved2 |
private int |
_fSize |
private byte[] |
_fType |
private int |
_height |
private int |
_infoHeaderSize |
private int |
_sizeImage |
private int |
_width |
private static int |
bitcount |
private int[] |
bitmap |
private static int |
BITMAPFILEHEADER_SIZE |
private static int |
BITMAPINFOHEADER_SIZE |
private static int |
clrImportant |
private static int |
clrUsed |
private static int |
compression |
private static int |
planes |
private static long |
serialVersionUID |
private static int |
xPelsPerMeter |
private static int |
yPelsPerMeter |
Constructor and Description |
---|
BMPFile() |
Modifier and Type | Method and Description |
---|---|
private boolean |
convertImage(java.awt.Image parImage,
int parWidth,
int parHeight)
Converts the memory image to the bitmap format (BRG).
|
private byte[] |
intToDWord(int parValue)
Converts an int to a double word, where the return value is stored in a 4-byte array.
|
private byte[] |
intToWord(int parValue)
Converts an int to a word, where the return value is stored in a 2-byte array.
|
void |
saveBitmap(java.lang.String filename,
java.awt.Image image,
int width,
int height) |
private void |
writeBitmap(java.io.FileOutputStream fo)
Converts the image returned from the pixel grabber to the format required.
|
private void |
writeBitmapFileHeader(java.io.FileOutputStream fo)
Writes the bitmap file header to the file.
|
private void |
writeBitmapInfoHeader(java.io.FileOutputStream fo)
Writes the bitmap information header to the file.
|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validate
private static final long serialVersionUID
private static final int BITMAPFILEHEADER_SIZE
private static final int BITMAPINFOHEADER_SIZE
private final byte[] _fType
private int _fSize
private final int _fReserved1
private final int _fReserved2
private final int _fOffBits
private final int _infoHeaderSize
private int _width
private int _height
private static final int planes
private static final int bitcount
private static final int compression
private int _sizeImage
private static final int xPelsPerMeter
private static final int yPelsPerMeter
private static final int clrUsed
private static final int clrImportant
private int[] bitmap
public void saveBitmap(java.lang.String filename, java.awt.Image image, int width, int height) throws java.io.IOException
java.io.IOException
private boolean convertImage(java.awt.Image parImage, int parWidth, int parHeight)
private void writeBitmap(java.io.FileOutputStream fo) throws java.io.IOException
java.io.IOException
private void writeBitmapFileHeader(java.io.FileOutputStream fo) throws java.io.IOException
java.io.IOException
private void writeBitmapInfoHeader(java.io.FileOutputStream fo) throws java.io.IOException
java.io.IOException
private byte[] intToWord(int parValue)
private byte[] intToDWord(int parValue)
Copyright 2009-2015 Tatjana (Tanja) Kostic