|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jniwrapper.Parameter com.jniwrapper.Pointer.Void com.jniwrapper.win32.Handle com.jniwrapper.win32.gdi.GdiObject com.jniwrapper.win32.gdi.Bitmap
public abstract class Bitmap
This class represents common functionality for working with bitmaps.
Nested Class Summary | |
---|---|
static class |
Bitmap.Compression
Class Compression represents compression level enumeration. |
static class |
Bitmap.PredefinedBitmap
Class PredefinedBitmap enumeration represents predefined windows bitmaps. |
Nested classes/interfaces inherited from class com.jniwrapper.win32.gdi.GdiObject |
---|
GdiObject.ImageLoadParameters, GdiObject.ImageType, GdiObject.Type |
Field Summary | |
---|---|
protected static BitmapBuilderFactory |
_builderFactory
|
protected static int |
BLACK_COLOR
|
protected static int |
CBM_INIT
Initialize bitmap. |
protected static int |
DIB_PAL_COLORS
Color table in palette indixes. |
protected static int |
DIB_RGB_COLORS
Color table in RGB. |
protected static java.lang.String |
FUNCTION_CREATEDIBITMAP
|
protected static java.lang.String |
FUNCTION_GET_DIBITS
|
protected static java.lang.String |
FUNCTION_SET_DIBITS
|
protected static int |
WHITE_COLOR
|
Fields inherited from class com.jniwrapper.win32.gdi.GdiObject |
---|
GDI_ERROR, HGDI_ERROR |
Fields inherited from class com.jniwrapper.win32.Handle |
---|
INFINITE_TIMEOUT, INVALID_HANDLE_VALUE, STATUS_ABANDONED_WAIT_0, STATUS_TIMEOUT, STATUS_WAIT_0 |
Fields inherited from class com.jniwrapper.Parameter |
---|
LICENSE_TYPE, V |
Constructor Summary | |
---|---|
Bitmap()
|
|
Bitmap(long value)
|
Method Summary | |
---|---|
void |
createDIBSection(DIBitmap result,
DC hdc,
BitmapInfo bitmapInfo,
int colorModel,
com.jniwrapper.Pointer ppvBits,
Handle hSection,
int dwOffset)
Creates a handle to device independent bitmap (DIB). |
void |
createDIBSection(DIBitmap result,
com.jniwrapper.Pointer ppvBits,
BitmapInfo bitmapInfo)
Creates a handle to device independent bitmap (DIB). |
void |
deleteObject()
Deletes the object. |
int |
getBitCount()
Returns the number of bits per pixel. |
abstract BitmapInfo |
getBitmapInfo()
|
abstract BitmapInfoHeader |
getBitmapInfoHeader()
|
int |
getBitmapLineLength()
Return number of pixels in line. |
abstract byte[] |
getBytes()
Returns array of device independent bitmap bytes as byte array. |
protected static int |
getBytesCount(int height,
int width,
int bitPerPixel)
Return number of bytes in bitmap |
long |
getDIBits(DC dc,
int startScan,
int scanLines,
com.jniwrapper.Pointer.Void bits,
BitmapInfo bitmapInfo,
int colorModelType)
Returns bits of a bitmap. |
long |
getDIBits(DC dc,
int startScan,
int scanLines,
com.jniwrapper.Pointer bits,
BitmapInfo bitmapInfo,
int colorModelType)
Returns bits of a bitmap. |
abstract com.jniwrapper.PrimitiveArray |
getDIBytes()
Deprecated. use {#getBytes} method to obtain byte array of image |
int |
getHeight()
Returns bitmap height in pixels. |
Size |
getSize()
Return bitmap size as an Size object instance. |
Bitmap |
getTransparentMask()
Returns transparancy bitmap mask. |
int |
getWidth()
Returns bitmap width. |
boolean |
isTransparent()
Returns true if a transparent bitmap. |
abstract void |
loadFromFile(java.lang.String fileName)
|
void |
saveToFile(java.lang.String fileName)
Saves bitmap to the specified file. |
long |
setDIBits(DC dc,
int startScan,
int scanLines,
com.jniwrapper.Pointer bits,
BitmapInfo bitmapInfo,
int colorModelType)
Sets bits for a bitmap. |
abstract void |
setDIBytes(com.jniwrapper.PrimitiveArray bytes)
Sets bytes of the bitmap. |
protected void |
setSize(int width,
int height)
Sets bitmap size in pixels. |
protected void |
setTransparentMask(java.awt.Image transparentMask)
Sets transparency mask using input image. |
java.awt.image.BufferedImage |
toImage()
Converts windows Bitmap to BufferedImage . |
Methods inherited from class com.jniwrapper.win32.gdi.GdiObject |
---|
getObject, getObjectType |
Methods inherited from class com.jniwrapper.win32.Handle |
---|
clone, closeHandle, equals, waitFor, waitFor |
Methods inherited from class com.jniwrapper.Pointer.Void |
---|
asFunction, asFunction, asTypedPointer, castTo, castTo, getDebugInfo, getLength, getValue, hashCode, isNull, read, setValue, toString, write |
Methods inherited from class com.jniwrapper.Parameter |
---|
|
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final BitmapBuilderFactory _builderFactory
protected static final java.lang.String FUNCTION_GET_DIBITS
protected static final java.lang.String FUNCTION_SET_DIBITS
protected static final java.lang.String FUNCTION_CREATEDIBITMAP
protected static final int BLACK_COLOR
protected static final int WHITE_COLOR
protected static final int DIB_RGB_COLORS
protected static final int DIB_PAL_COLORS
protected static final int CBM_INIT
Constructor Detail |
---|
public Bitmap()
public Bitmap(long value)
Method Detail |
---|
public long setDIBits(DC dc, int startScan, int scanLines, com.jniwrapper.Pointer bits, BitmapInfo bitmapInfo, int colorModelType)
dc
- dc compatible with a bitmap.startScan
- start scanline in a bitmap.scanLines
- the number of scanlines in a bitmap.bits
- a pointer to PrimitiveArray of UInt8 (result bits).bitmapInfo
- BitmapInfo structure describing a bitmap.colorModelType
- a type of color model.
public long getDIBits(DC dc, int startScan, int scanLines, com.jniwrapper.Pointer bits, BitmapInfo bitmapInfo, int colorModelType)
dc
- dc compatible with a bitmap.startScan
- start scanline in bitmap.scanLines
- the number of scanlines in a bitmap.bits
- a pointer to PrimitiveArray of UInt8 (result bits).bitmapInfo
- BitmapInfo structure describing a bitmap.colorModelType
- a type of color model.
public long getDIBits(DC dc, int startScan, int scanLines, com.jniwrapper.Pointer.Void bits, BitmapInfo bitmapInfo, int colorModelType)
dc
- dc compatible with a bitmap.startScan
- start scanline in bitmap.scanLines
- the number of scanlines in a bitmap.bits
- a pointer to PrimitiveArray of UInt8 (result bits).bitmapInfo
- BitmapInfo structure describing a bitmap.colorModelType
- a type of color model.
protected void setSize(int width, int height)
width
- height
- public Size getSize()
public int getWidth()
public int getHeight()
public void createDIBSection(DIBitmap result, com.jniwrapper.Pointer ppvBits, BitmapInfo bitmapInfo)
result
- [out] is a handle to DIB.ppvBits
- [out] is a pointer to the location of bits in DIB section.bitmapInfo
- [in] describes source DDBitmap.public void createDIBSection(DIBitmap result, DC hdc, BitmapInfo bitmapInfo, int colorModel, com.jniwrapper.Pointer ppvBits, Handle hSection, int dwOffset)
result
- [out] is a handle to DIB.hdc
- [in] is a handle to the DC of source DDBitmap.bitmapInfo
- [in] describes source DDBitmap.colorModel
- [in] is the type of color model.ppvBits
- [out] is a pointer to the location of bits in DIB section.hSection
- [in] is a hable to DIB section.dwOffset
- [in] is an offset of bits location in DIB section.public int getBitCount()
protected void setTransparentMask(java.awt.Image transparentMask)
transparentMask
- - an imagepublic Bitmap getTransparentMask()
public boolean isTransparent()
public void deleteObject()
deleteObject
in class GdiObject
public java.awt.image.BufferedImage toImage()
BufferedImage
.
protected static int getBytesCount(int height, int width, int bitPerPixel)
height
- - number of lineswidth
- - number of rowsbitPerPixel
- - number of bits on pixel
public int getBitmapLineLength()
public void saveToFile(java.lang.String fileName) throws java.io.IOException
fileName
- path to the file where the bitmap will be saved.
java.io.IOException
public abstract BitmapInfoHeader getBitmapInfoHeader()
public abstract BitmapInfo getBitmapInfo()
public abstract void loadFromFile(java.lang.String fileName)
public abstract com.jniwrapper.PrimitiveArray getDIBytes()
public abstract byte[] getBytes()
public abstract void setDIBytes(com.jniwrapper.PrimitiveArray bytes)
bytes
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |