com.aspose.imaging.fileformats.bmp
Class BmpImage

java.lang.Object
  extended by com.aspose.imaging.DisposableObject
      extended by com.aspose.imaging.DataStreamSupporter
          extended by com.aspose.imaging.Image
              extended by com.aspose.imaging.RasterImage
                  extended by com.aspose.imaging.fileformats.bmp.BmpImage
All Implemented Interfaces:
IObjectWithBounds

public final class BmpImage
extends RasterImage

A bmp image.


Field Summary
static int BYTE_BITS_COUNT
           Represents the byte bits count.
static int BYTE_ROUNDING_BITS_COUNT
           Represents a number of bits to get rounded byte.
 
Constructor Summary
BmpImage(BmpStreamHeader bmpStreamHeader)
           Initializes a new instance of the BmpImage class.
BmpImage(BmpStreamHeader bmpStreamHeader, IColorPalette colorPalette, boolean useCompactPalette)
           Initializes a new instance of the BmpImage class.
 
Method Summary
 int getBitsPerPixel()
           Gets the image bits per pixel count.
 int getHeight()
           Gets the image height.
 double getHorizontalResolution()
           Gets the horizontal resolution, in pixels per inch, of this RasterImage.
 java.lang.String getImageLoaderDescriptorName()
           Gets the name of the image loader descriptor.
 double getVerticalResolution()
           Gets the vertical resolution, in pixels per inch, of this RasterImage.
 int getWidth()
           Gets the image width.
protected  void onCompactPaletteUsageChanged()
           Called when compact palette usage is changed.
protected  void onPaletteChanged(IColorPalette oldPalette, IColorPalette newPalette)
           Called when palette is changed.
protected  void onPaletteChanging(IColorPalette oldPalette, IColorPalette newPalette)
           Called when palette is changing.
 void resize(int newWidth, int newHeight, int resizeType)
           Resizes the image.
 void rotateFlip(int rotateFlipType)
           Rotates, flips, or rotates and flips the image.
 void setHorizontalResolution(double value)
           Sets the horizontal resolution, in pixels per inch, of this RasterImage.
 void setResolution(double dpiX, double dpiY)
           Sets the resolution for this RasterImage.
 void setVerticalResolution(double value)
           Sets the vertical resolution, in pixels per inch, of this RasterImage.
 
Methods inherited from class com.aspose.imaging.RasterImage
getPixel, loadPixels, loadPixelsInternal, readScanLine, releaseManagedResources, rotateFlip, savePixels, savePixelsInternal, setPalette, setPixel, writeScanLine
 
Methods inherited from class com.aspose.imaging.Image
canLoad, canLoad, canLoad, canLoad, canSave, create, getBounds, getContainer, getFileFormat, getFileFormat, getFitRectangle, getFitRectangle, getFittingRectangle, getFittingRectangle, getPalette, getSize, getUseCompactPalette, load, load, resize, save, save, save, setContainer, setPalette, setUseCompactPalette
 
Methods inherited from class com.aspose.imaging.DataStreamSupporter
flush, getDataStreamContainer, onDataStreamContainerChanging, save, save, setDataStreamContainer
 
Methods inherited from class com.aspose.imaging.DisposableObject
dispose, getDisposed, releaseUnmanagedResources, verifyNotDisposed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BYTE_BITS_COUNT

public static final int BYTE_BITS_COUNT

Represents the byte bits count.

See Also:
Constant Field Values

BYTE_ROUNDING_BITS_COUNT

public static final int BYTE_ROUNDING_BITS_COUNT

Represents a number of bits to get rounded byte.

See Also:
Constant Field Values
Constructor Detail

BmpImage

public BmpImage(BmpStreamHeader bmpStreamHeader)

Initializes a new instance of the BmpImage class.

Parameters:
bmpStreamHeader - The bmp stream header.

BmpImage

public BmpImage(BmpStreamHeader bmpStreamHeader,
                IColorPalette colorPalette,
                boolean useCompactPalette)

Initializes a new instance of the BmpImage class.

Parameters:
bmpStreamHeader - The bmp stream header.
colorPalette - The color palette.
useCompactPalette - if set to true compact palette is used.
Method Detail

getBitsPerPixel

public int getBitsPerPixel()

Gets the image bits per pixel count.

Value: The image bits per pixel count.

Specified by:
getBitsPerPixel in class Image

getHeight

public int getHeight()

Gets the image height.

Value: The image height.

Specified by:
getHeight in interface IObjectWithBounds
Specified by:
getHeight in class Image

getHorizontalResolution

public double getHorizontalResolution()

Gets the horizontal resolution, in pixels per inch, of this RasterImage.

Value: The horizontal resolution.


Note by default this value is always 96 since different platforms cannot return the screen resolution. You may consider using the SetResolution method for updating both resolution values in single call.

Overrides:
getHorizontalResolution in class RasterImage

getImageLoaderDescriptorName

public java.lang.String getImageLoaderDescriptorName()

Gets the name of the image loader descriptor.

Value: The name of the image loader descriptor.


This value is used later for proper image deserialization, thus specify valid registered descriptor here. During deserialization each descriptor type name is validated against this value.

Specified by:
getImageLoaderDescriptorName in class Image

getVerticalResolution

public double getVerticalResolution()

Gets the vertical resolution, in pixels per inch, of this RasterImage.

Value: The vertical resolution.


Note by default this value is always 96 since different platforms cannot return the screen resolution. You may consider using the SetResolution method for updating both resolution values in single call.

Overrides:
getVerticalResolution in class RasterImage

getWidth

public int getWidth()

Gets the image width.

Value: The image width.

Specified by:
getWidth in interface IObjectWithBounds
Specified by:
getWidth in class Image

onCompactPaletteUsageChanged

protected void onCompactPaletteUsageChanged()

Called when compact palette usage is changed.

Overrides:
onCompactPaletteUsageChanged in class Image

onPaletteChanged

protected void onPaletteChanged(IColorPalette oldPalette,
                                IColorPalette newPalette)

Called when palette is changed.

Overrides:
onPaletteChanged in class Image
Parameters:
oldPalette - The old palette.
newPalette - The new palette.

onPaletteChanging

protected void onPaletteChanging(IColorPalette oldPalette,
                                 IColorPalette newPalette)

Called when palette is changing.

Overrides:
onPaletteChanging in class Image
Parameters:
oldPalette - The old palette.
newPalette - The new palette.

resize

public void resize(int newWidth,
                   int newHeight,
                   int resizeType)

Resizes the image.

Overrides:
resize in class RasterImage
Parameters:
newWidth - The new width.
newHeight - The new height.
resizeType - The resize type.

rotateFlip

public void rotateFlip(int rotateFlipType)

Rotates, flips, or rotates and flips the image.

Overrides:
rotateFlip in class RasterImage
Parameters:
rotateFlipType - Type of the rotate flip.

setHorizontalResolution

public void setHorizontalResolution(double value)

Sets the horizontal resolution, in pixels per inch, of this RasterImage.

Value: The horizontal resolution.


Note by default this value is always 96 since different platforms cannot return the screen resolution. You may consider using the SetResolution method for updating both resolution values in single call.

Overrides:
setHorizontalResolution in class RasterImage

setResolution

public void setResolution(double dpiX,
                          double dpiY)

Sets the resolution for this RasterImage.

Overrides:
setResolution in class RasterImage
Parameters:
dpiX - The horizontal resolution, in dots per inch, of the RasterImage.
dpiY - The vertical resolution, in dots per inch, of the RasterImage.

setVerticalResolution

public void setVerticalResolution(double value)

Sets the vertical resolution, in pixels per inch, of this RasterImage.

Value: The vertical resolution.


Note by default this value is always 96 since different platforms cannot return the screen resolution. You may consider using the SetResolution method for updating both resolution values in single call.

Overrides:
setVerticalResolution in class RasterImage