public final class BmpImage
extends com.aspose.imaging.RasterCachedImage
A bmp image.
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 |
---|---|
static BmpImage |
createInstance_internalized(com.aspose.imaging_internal.fileformats.bmp.BmpStreamHeader bmpStreamHeader,
IColorPalette colorPalette,
com.aspose.imaging_internal.fileformats.bmp.BmpDataReader dataReader)
Creates the new instance of the
BmpImage class. |
BitmapInfoHeader |
getBitmapInfoHeader()
Gets the bitmap information header.
|
int |
getBitsPerPixel()
Gets the image bits per pixel count.
|
long |
getCompression()
Gets the image compression.
|
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.
|
static void |
saveBmp_internalized(RasterImage imageToLoadPixelsFrom,
com.aspose.imaging.StreamContainer streamContainer,
com.aspose.imaging_internal.fileformats.bmp.BmpStreamHeader header,
IColorPalette palette,
Rectangle destImageBounds)
Saves the image into BMP file format.
|
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, beginResize_internalized, binarizeBradley, binarizeFixed, binarizeOtsu, cacheData, crop, dither, getFormatSpecificPalette_internalized, grayscale, isCached, resize, resize, rotate, rotateFlip, setFormatSpecificPalette_internalized
crop, dither, filter, getArgb32Pixel, getDefaultArgb32Pixels, getDefaultPixels, getDefaultRawData, getDefaultRawData, getPixel, getRawCustomColorConverter, getRawDataSettings, getRawFallbackIndex, getRawIndexedColorConverter, getTransparentColor, getXmpData, hasAlpha, hasTransparentColor, isRawDataAvailable, loadArgb32Pixels, loadCmykPixels, loadPartialArgb32Pixels, loadPartialPixels, loadPixels, loadRawData, readScanLine, rotate, saveArgb32Pixels, saveCmykPixels, savePixels, saveRawData, setArgb32Pixel, setPalette, setPixel, setRawCustomColorConverter, setRawFallbackIndex, setRawIndexedColorConverter, setTransparentColor, setTransparentColor, setXmpData, writeScanLine
canLoad, canLoad, canLoad, canLoad, canLoadInternal_internalized, canLoadInternal_internalized, canSave, create, getBackgroundColor, getBounds, getContainer, getFileFormat, getFileFormat, getFileFormatInternal_internalized, getFittingRectangle, getFittingRectangle, getPalette, getProportionalHeight, getProportionalWidth, getSize, getVentureLicense_internalized, hasBackgroundColor, load, load, load, load, loadInternal_internalized, loadInternal_internalized, resize, resizeHeightProportionally, resizeHeightProportionally, resizeHeightProportionally, resizeWidthProportionally, resizeWidthProportionally, resizeWidthProportionally, save_internalized, save, save, save, save, save, setBackgroundColor, setBackgroundColor, setContainer_internalized, setPalette, setVentureLicense_internalized
getDataStreamContainer, save_internalized, save, save, save, setDataStreamContainer
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 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
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
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
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
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
.public static BmpImage createInstance_internalized(com.aspose.imaging_internal.fileformats.bmp.BmpStreamHeader bmpStreamHeader, IColorPalette colorPalette, com.aspose.imaging_internal.fileformats.bmp.BmpDataReader dataReader)
Creates the new instance of the BmpImage
class.
bmpStreamHeader
- The BMP stream header.colorPalette
- The color palette.dataReader
- The data reader.BmpImage
class.public static void saveBmp_internalized(RasterImage imageToLoadPixelsFrom, com.aspose.imaging.StreamContainer streamContainer, com.aspose.imaging_internal.fileformats.bmp.BmpStreamHeader header, IColorPalette palette, Rectangle destImageBounds)
Saves the image into BMP file format.
imageToLoadPixelsFrom
- The image to load pixels from.streamContainer
- The stream container to save to.header
- The header to use for saving.palette
- The palette to use.destImageBounds
- The dest image bounds.Copyright (c) 2008-2016 Aspose Pty Ltd. All Rights Reserved.