public final class BmpImage extends RasterCachedImage
A bmp image.
RasterCachedImage.RotateTestMode
Constructor and Description |
---|
BmpImage(InputStream stream)
Initializes a new instance of the
BmpImage class. |
BmpImage(InputStream stream,
int bitsPerPixel,
long compression,
double horizontalResolution,
double verticalResolution)
Initializes a new instance of the
BmpImage class. |
BmpImage(int width,
int height)
Initializes a new instance of the
BmpImage class. |
BmpImage(int width,
int height,
int bitsPerPixel,
IColorPalette palette)
Initializes a new instance of the
BmpImage class. |
BmpImage(int width,
int height,
int bitsPerPixel,
IColorPalette palette,
long compression,
double horizontalResolution,
double verticalResolution)
Initializes a new instance of the
BmpImage class. |
BmpImage(RasterImage rasterImage)
Initializes a new instance of the
BmpImage class. |
BmpImage(RasterImage rasterImage,
int bitsPerPixel,
long compression,
double horizontalResolution,
double verticalResolution)
Initializes a new instance of the
BmpImage class. |
BmpImage(String path)
Initializes a new instance of the
BmpImage class. |
BmpImage(String path,
int bitsPerPixel,
long compression,
double horizontalResolution,
double verticalResolution)
Initializes a new instance of the
BmpImage class. |
Modifier and Type | Method and Description |
---|---|
BitmapInfoHeader |
getBitmapInfoHeader()
Gets the bitmap information header.
|
int |
getBitsPerPixel()
Gets the image bits per pixel count.
|
long |
getCompression()
Gets the image compression.
|
long |
getFileFormat()
Gets a value of file format
|
int |
getHeight()
Gets the image height.
|
double |
getHorizontalResolution()
Gets or sets the horizontal resolution, in pixels per inch, of this
RasterImage . |
PixelDataFormat |
getRawDataFormat()
Gets the raw data format.
|
int |
getRawLineSize()
Gets the raw line size in bytes.
|
double |
getVerticalResolution()
Gets or sets the vertical resolution, in pixels per inch, of this
RasterImage . |
int |
getWidth()
Gets the image width.
|
void |
setHorizontalResolution(double value)
Gets or 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)
Gets or sets the vertical resolution, in pixels per inch, of this
RasterImage . |
adjustBrightness, adjustContrast, adjustGamma, adjustGamma, binarizeBradley, binarizeFixed, binarizeOtsu, cacheData, crop, dither, getMaxAllowedAllocationForPartialRotateSave, getRotateMode, grayscale, isCached, resize, resize, rotate, rotateFlip, setMaxAllowedAllocationForPartialRotateSave, setRotateMode
crop, dither, filter, getArgb32Pixel, getDefaultArgb32Pixels, getDefaultPixels, getDefaultRawData, getDefaultRawData, getImageOpacity, getModifyDate, getPixel, getPremultiplyComponents, getRawCustomColorConverter, getRawDataSettings, getRawFallbackIndex, getRawIndexedColorConverter, getTransparentColor, getUpdateXmpData, getUseRawData, getXmpData, hasAlpha, hasTransparentColor, isRawDataAvailable, loadArgb32Pixels, loadCmyk32Pixels, loadCmykPixels, loadPartialArgb32Pixels, loadPartialPixels, loadPixels, loadRawData, loadRawData, readArgb32ScanLine, readScanLine, replaceColor, replaceColor, replaceNonTransparentColors, replaceNonTransparentColors, rotate, saveArgb32Pixels, saveCmyk32Pixels, saveCmykPixels, savePixels, saveRawData, setArgb32Pixel, setPalette, setPixel, setPremultiplyComponents, setRawCustomColorConverter, setRawFallbackIndex, setRawIndexedColorConverter, setTransparentColor, setTransparentColor, setUpdateXmpData, setUseRawData, setXmpData, toBitmap, writeArgb32ScanLine, writeScanLine
canLoad, canLoad, canLoad, canLoad, canSave, create, getBackgroundColor, getBounds, getContainer, getDefaultOptions, getFileFormat, getFileFormat, getFittingRectangle, getFittingRectangle, getInterruptMonitor, getOriginalOptions, getPalette, getProportionalHeight, getProportionalWidth, getSize, hasBackgroundColor, isAutoAdjustPalette, load, load, load, load, load, load, resize, resizeHeightProportionally, resizeHeightProportionally, resizeHeightProportionally, resizeWidthProportionally, resizeWidthProportionally, resizeWidthProportionally, save, save, save, save, save, save, save, setAutoAdjustPalette, setBackgroundColor, setBackgroundColor, setInterruptMonitor, setPalette
getDataStreamContainer, save, save, save, save
close, dispose, getDisposed
public BmpImage(String path)
Initializes a new instance of the BmpImage
class.
path
- The path to load image from and initialize pixel and palette data with.com.aspose.ms.System.ArgumentNullException
- raster image is null;rasterImageBmpImageException
- The height should be positive.com.aspose.ms.System.ArgumentException
- Palette should be specified for images with 8 bits per pixel or less.;palettepublic BmpImage(String path, int bitsPerPixel, long compression, double horizontalResolution, double verticalResolution)
Initializes a new instance of the BmpImage
class.
path
- The path to load image from and initialize pixel and palette data with.bitsPerPixel
- The bits per pixel.compression
- The compression to use.horizontalResolution
- The horizontal resolution. Note due to the rounding the resulting resolution may slightly differ from the passed.verticalResolution
- The vertical resolution. Note due to the rounding the resulting resolution may slightly differ from the passed.com.aspose.ms.System.ArgumentNullException
- The raster image cannot be null;rasterImageBmpImageException
- The height should be positive.com.aspose.ms.System.ArgumentException
- Palette should be specified for images with 8 bits per pixel or less.;palettepublic BmpImage(InputStream stream)
Initializes a new instance of the BmpImage
class.
stream
- The stream to load image from and initialize pixel and palette data with.com.aspose.ms.System.ArgumentNullException
- The raster image cannot be null;rasterImageBmpImageException
- The height should be positive.com.aspose.ms.System.ArgumentException
- Palette should be specified for images with 8 bits per pixel or less.;palettepublic BmpImage(InputStream stream, int bitsPerPixel, long compression, double horizontalResolution, double verticalResolution)
Initializes a new instance of the BmpImage
class.
stream
- The stream to load image from and initialize pixel and palette data with.bitsPerPixel
- The bits per pixel.compression
- The compression to use.horizontalResolution
- The horizontal resolution. Note due to the rounding the resulting resolution may slightly differ from the passed.verticalResolution
- The vertical resolution. Note due to the rounding the resulting resolution may slightly differ from the passed.com.aspose.ms.System.ArgumentNullException
- The raster image cannot be null;rasterImageBmpImageException
- The height should be positive.com.aspose.ms.System.ArgumentException
- Palette should be specified for images with 8 bits per pixel or less.;palettepublic BmpImage(RasterImage rasterImage)
Initializes a new instance of the BmpImage
class.
rasterImage
- The image to initialize pixel and palette data with.com.aspose.ms.System.ArgumentNullException
- The raster image cannot be null;rasterImageBmpImageException
- The height should be positive.com.aspose.ms.System.ArgumentException
- Palette should be specified for images with 8 bits per pixel or less.;palettepublic BmpImage(RasterImage rasterImage, int bitsPerPixel, long compression, double horizontalResolution, double verticalResolution)
Initializes a new instance of the BmpImage
class.
rasterImage
- The image to initialize pixel and palette data with.bitsPerPixel
- The bits per pixel.compression
- The compression to use.horizontalResolution
- The horizontal resolution. Note due to the rounding the resulting resolution may slightly differ from the passed.verticalResolution
- The vertical resolution. Note due to the rounding the resulting resolution may slightly differ from the passed.com.aspose.ms.System.ArgumentNullException
- The raster image cannot be null;rasterImageBmpImageException
- The height should be positive.com.aspose.ms.System.ArgumentException
- Palette should be specified for images with 8 bits per pixel or less.;palettepublic BmpImage(int width, int height)
Initializes a new instance of the BmpImage
class.
width
- The image width.height
- The image height.BmpImageException
- The height should be positive.com.aspose.ms.System.ArgumentException
- Palette should be specified for images with 8 bits per pixel or less.;palettepublic BmpImage(int width, int height, int bitsPerPixel, IColorPalette palette)
Initializes a new instance of the BmpImage
class.
width
- The image width.height
- The image height.bitsPerPixel
- The bits per pixel.palette
- The color palette.BmpImageException
- The height should be positive.com.aspose.ms.System.ArgumentException
- Palette should be specified for images with 8 bits per pixel or less.;palettepublic BmpImage(int width, int height, int bitsPerPixel, IColorPalette palette, long compression, double horizontalResolution, double verticalResolution)
Initializes a new instance of the BmpImage
class.
width
- The image width.height
- The image height.bitsPerPixel
- The bits per pixel.palette
- The color palette.compression
- The compression to use.horizontalResolution
- The horizontal resolution. Note due to the rounding the resulting resolution may slightly differ from the passed.verticalResolution
- The vertical resolution. Note due to the rounding the resulting resolution may slightly differ from the passed.BmpImageException
- The height should be positive.com.aspose.ms.System.ArgumentException
- Palette should be specified for images with 8 bits per pixel or less.;palettepublic BitmapInfoHeader getBitmapInfoHeader()
Gets the bitmap information header.
Value: The bitmap information header.public long getFileFormat()
Gets a value of file format
getFileFormat
in class Image
public PixelDataFormat getRawDataFormat()
Gets the raw data format.
Value: The raw data format.getRawDataFormat
in class RasterImage
public int getRawLineSize()
Gets the raw line size in bytes.
Value: The raw line size in bytes.getRawLineSize
in class RasterImage
public long getCompression()
Gets the image compression.
Value: The image compression.public int getWidth()
Gets the image width.
Value: The image width.getWidth
in interface IObjectWithBounds
getWidth
in class Image
public int getHeight()
Gets the image height.
Value: The image height.getHeight
in interface IObjectWithBounds
getHeight
in class Image
public int getBitsPerPixel()
Gets the image bits per pixel count.
Value: The image bits per pixel count.getBitsPerPixel
in class Image
public double getHorizontalResolution()
Gets or sets the horizontal resolution, in pixels per inch, of this RasterImage
.
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.
getHorizontalResolution
in class RasterImage
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.
public void setHorizontalResolution(double value)
Gets or sets the horizontal resolution, in pixels per inch, of this RasterImage
.
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.
setHorizontalResolution
in class 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.
public double getVerticalResolution()
Gets or sets the vertical resolution, in pixels per inch, of this RasterImage
.
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.
getVerticalResolution
in class RasterImage
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.
public void setVerticalResolution(double value)
Gets or sets the vertical resolution, in pixels per inch, of this RasterImage
.
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.
setVerticalResolution
in class 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.
public void setResolution(double dpiX, double dpiY)
Sets the resolution for this RasterImage
.
setResolution
in class RasterImage
dpiX
- The horizontal resolution, in dots per inch, of the RasterImage
.dpiY
- The vertical resolution, in dots per inch, of the RasterImage
.Copyright (c) 2008-2018 Aspose Pty Ltd. All Rights Reserved.