BT_BitmapLoadFile(cFileName)
Loads an image (BMP, JPG, GIF, TIF or PNG) from the disk or resources and returns a handle to bitmap format image (hBitmap).
cFileName: is the name of the file or of the resource that contains the image.
BT_BitmapLoadEMF(cFileName, aRGBcolor_Fill_Bk, NewWidht, NewHeight, Mode_Stretch)
Loads an EMF (Enhanced Meta File) image from the disk or resources and returns a handle to bitmap format image (hBitmap).
cFileName: is the name of the file or of the resource that contains the image.
aRGBcolor_Fill_Bk: array containing the RGB colors that paint the background of the bitmap. For default: aRGBcolor_Fill_Bk = {0,0,0} = BLACK.
New_Width, New_Height: is the new size of the bitmap image. For default this values are the original width and height of the EMF image.
Mode_Stretch: sets the mode as the image of origin is adjusts (is stretches or compresses) in the new size bitmap, it is one of the constants: BT_SCALE or BT_STRETCH (defined in BosTaurus.CH). For default Mode_Stretch = BT_STRETCH.
BT_BitmapSaveFile(hBitmap, cFileName, nTypePicture)
Save an image (BMP, JPG, GIF, TIF or PNG) in the disk.
hBitmap: is a handle to the bitmap image.
cFileName: is the name of the file to save.
nTypePicture: specifies the format in which you want to save the image, it is one of the constants: BT_FILEFORMAT_BMP, BT_FILEFORMAT_JPG, BT_FILEFORMAT_GIF, BT_FILEFORMAT_TIF or BT_FILEFORMAT_PNG (defined in BosTaurus.CH). For default nTypePicture = BT_FILEFORMAT_BMP.
BT_BitmapRelease (hBitmap)
Release a bitmap of the memory.
hBitmap: is a handle to bitmap.
Note: all of the handles of bitmap obtained from load, create, clone, copy, etc. a bitmap image is responsibility of the application for his release before close.
BT_BitmapWidth(hBitmap)
Return the width of the specified bitmap in pixels.
hBitmap: is a handle to bitmap.
BT_BitmapHeight (hBitmap)
Return the height of the specified bitmap in pixels.
hBitmap: is a handle to bitmap.
BT_BitmapBitsPerPixel (hBitmap)
Return the bits per pixel of the specified bitmap.
hBitmap: is a handle to bitmap.
BT_BitmapCreateNew(Width, Height, aRGBcolor_Fill_Bk)
Creates a bitmap in the memory and returns a handle to bitmap (hBitmap).
Width, Height: are the dimensions of the bitmap in pixels.
aRGBcolor_Fill_Bk: array containing the RGB colors that paint the background of the bitmap. For default: aRGBcolor_Fill_Bk = {0,0,0} = BLACK.
BT_BitmapClone(hBitmap, Row, Col, Width, Height)
Clones the specified bitmap and returns a handle to the cloned bitmap.
hBitmap: is a handle to the origin bitmap.
Row, Col, Width, Height: specifies the dimensions in pixels of the rectangle to clone. For default: Row = 0, Col = 0, Width = BT_BitmapWidth(hBitmap), Height = BT_BitmapHeight(hBitmap).
BT_BitmapCopyAndResize(hBitmap, New_Width, New_Height, Mode_Stretch, Algorithm)
Copy and resizes the specified bitmap and returns a handle to the bitmap with the new size.
hBitmap: is a handle to the origin bitmap.
New_Width, New_Height: is the new size of the bitmap image.
Mode_Stretch: sets the mode as the bitmap of origin is adjusts (is stretches or compresses) in the new size bitmap, it is one of the constants: BT_SCALE or BT_STRETCH (defined in BosTaurus.CH). For default Mode_Stretch = BT_STRETCH.
Algorithm: sets the mode as the bitmap is resized, it is one of the constants: BT_RESIZE_COLORONCOLOR, BT_RESIZE_HALFTONE or BT_RESIZE_BILINEAR (defined in BosTaurus.CH). For default Algorithm = BT_RESIZE_HALFTONE.
BT_BitmapPaste(hBitmap_D, Row_D, Col_D, Width_D, Height_D, Mode_Stretch, hBitmap_O)
Paste a bitmap (origin) into another bitmap (destination).
hBitmap_D: is a handle to the destination bitmap.
Row_D, Col_D, Width_D, Height_D: specifies the size of the rectangle in pixels in the destination bitmap where you will paste the origin bitmap. For default: Row_D = 0, Col_D = 0, Width = BT_BitmapWidth(hBitmap_D), Height = BT_BitmapHeight(hBitmap_D).
Mode_Stretch: sets the mode as the bitmap of origin is adjusts (is stretches or compresses) in the specified rectangle in the destination bitmap, it is one of the constants: BT_SCALE, BT_STRETCH or BT_COPY (defined in BosTaurus.CH).
hBitmap_O: is a handle to the origin bitmap.
BT_BitmapPasteTransparent(hBitmap_D, Row_D, Col_D, Width_D, Height_D, Mode_Stretch, hBitmap_O, aRGBcolor_transp)
Paste a transparent bitmap (origin) into another bitmap (destination).
hBitmap_D: is a handle to the destination bitmap.
Row_D, Col_D, Width_D, Height_D: specifies the size of the rectangle in pixels in the destination bitmap where you will paste the origin bitmap. For default: Row_D = 0, Col_D = 0, Width = BT_BitmapWidth(hBitmap_D), Height = BT_BitmapHeight(hBitmap_D).
Mode_Stretch: sets the mode as the bitmap of origin is adjusts (is stretches or compresses) in the specified rectangle in the destination bitmap, it is one of the constants: BT_SCALE, BT_STRETCH or BT_COPY (defined in BosTaurus.CH).
hBitmap_O: is a handle to the origin bitmap.
aRGBcolor_transp: array containing the RGB colors to treat as transparent in the origin bitmap. For default: aRGBcolor_transp = color of the first pixel of the origin bitmap.
BT_BitmapPasteAlphaBlend(hBitmap_D, Row_D, Col_D, Width_D, Height_D, Alpha, Mode_Stretch, hBitmap_O)
Paste a bitmap (origin) with Alpha Blend effect (that make the pixels to be transparent or semi transparent) into another bitmap (destination).
hBitmap_D: is a handle to the destination bitmap.
Row_D, Col_D, Width_D, Height_D: specifies the size of the rectangle in pixels in the destination bitmap where you will paste the origin bitmap. For default: Row_D = 0, Col_D = 0, Width = BT_BitmapWidth(hBitmap_D), Height = BT_BitmapHeight(hBitmap_D).
Alpha: is alpha blending value to be applied to the entire source bitmap (range 0 to 255, transparent = 0, opaque = 255).
Mode_Stretch: sets the mode as the bitmap of origin is adjusts (is stretches or compresses) in the specified rectangle in the destination bitmap, it is one of the constants: BT_SCALE, BT_STRETCH or BT_COPY (defined in BosTaurus.CH).
hBitmap_O: is a handle to the origin bitmap.
BT_BitmapInvert(hBitmap)
Invert the colors of an image (makes a negative of the original image).
hBitmap: is a handle to bitmap.
BT_BitmapGrayness(hBitmap, Gray_Level)
Set the grayness of the specified bitmap.
hBitmap: is a handle to bitmap.
Gray_Level: is the gray level in percentage (range 0 to 100%, none = 0, full = 100).
BT_BitmapBrightness(hBitmap, Light_Level)
Change the brightness of the specified bitmap.
hBitmap: is a handle to bitmap.
Light_Level is the light level (range -255 to +255, black = -255, white = +255, none = 0).
BT_BitmapContrast(hBitmap, ContrastAngle)
Increase the contrast of the colors in an image.
hBitmap: is a handle to bitmap.
ContrastAngle: is the angle of the slope (in radians) of the contrast transform.
BT_BitmapModifyColor(hBitmap, RedLevel, GreenLevel, BlueLevel)
Increases or decreases the colors channels of an image.
hBitmap: is a handle to bitmap.
RedLevel: is the Red color level to change (range -255 to +255, none = 0).
GreenLevel: is the Green color level to change (range -255 to +255, none = 0).
BlueLevel: is the Blue color level to change (range -255 to +255, none = 0).
BT_BitmapGammaCorrect(hBitmap, RedGamma, GreenGamma, BlueGamma)
Image displaying suffers from photometric distortions caused by the nonlinear response of display devices to lightness. The photometric response of a displaying device is known as the gamma response characteristic. Display monitors for different operating systems use different gammas. To compensate for these differences, the gamma of the image needs to be corrected. A gamma correction with gamma equal to 1.0 is an identity color transformation. Gamma less than 1.0 makes a picture look darker, and gamma larger than 1.0 makes a picture look lighter.
hBitmap: is a handle to bitmap.
RedGamma: is the Gamma Red color level to change (normally range between 0.2 and 5.0, none = 1.0).
GreenGamma: is the Gamma Green color level to change (normally range between 0.2 and 5.0, none = 1.0).
BlueGamma: is the Gamma Blue color level to change (normally range between 0.2 and 5.0, none = 1.0).
BT_BitmapConvolutionFilter3x3(hBitmap, aFilter)
The convolution is a matrix (or two-dimensional arrangement) applied to an image. The elements of this array are integers values. The result of this operation is a new image that has been filtered. The convolution basically modifies the color of a pixel based on the color of the neighboring pixels. For each color channel, the color value for each pixel is calculated on the original color and the color of the surrounding pixels.
hBitmap: is a handle to bitmap.
aFilter: is an array with the following values:
{ k1, k2, k3,
k4, k5, k6,
k7, k8, k9,
Divisor, Bias }
Where k1 ... k9 are the values of the 3x3 matrix that multiply the pixels. The center cell value (k5) multiplies the pixel that is currently processing. Divisor determines the brightness of the final image and Bias increments (positive value) or decrements (negative value) the end color of the currently processed pixel. For more details see the demo10.
RULES OF THUMB TO CREATE USER DEFINED FILTERS
Center Cell Value (k5) | Surrounding Cell Values (k1, k2, k3, k4, k6, k7, k8, k9) | |
---|---|---|
Blur | POSITIVE | Symmetrical pattern of POSITIVE values |
Sharpen | POSITIVE | Symmetrical pattern of NEGATIVE values |
Edges | NEGATIVE | Symmetrical pattern of POSITIVE values |
Emboss | POSITIVE | Symmetrical pattern of NEGATIVE values |
Center Cell Value = k5
Surrounding Cell Values = k1, k2, k3, k4, k6, k7, k8, k9
Sum = (Center Cell Value) + (Surrounding Cell Values)
Sum = k1 + k2 + k3 + k4 + k5 + k6 + k7 + k8 + k9
If Sum \/ Divisor = 1 ---> Retain the brightness of the original image.
If Sum \/ Divisor > 1 ---> Increases the bright of the image
If Sum \/ Divisor < 1 ---> Darken the image
To reduce the effect of a filter (Blur, Sharpen, Edges, etc.) you must increase the value of the center cell (k5)
BT_BitmapTransform (hBitmap, Mode, Angle, aRGBColor_Fill_Bk)
Reflects and\/or rotates of the specified bitmap and returns a handle to the new transformed bitmap.
hBitmap: is a handle to the origin bitmap.
Mode _is one or a combination (sum) of the constants BT_BITMAP_REFLECT_HORIZONTAL, BT_BITMAP_REFLECT_VERTICAL and BT_BITMAP_ROTATE _(defined in BosTaurus.CH).
Angle: is the angle at which it is to rotate the image (range 0 to 360º). This parameter is considered only if BT_BITMAP_ROTATE is set in Mode, otherwise it is ignored.
aRGBColor_Fill_Bk: array containing the RGB colors to fill the empty spaces of the background of the image. This parameter is considered only if BT_BITMAP_ROTATE is set in Mode, otherwise it is ignored. For default: aRGBcolor_Fill_Bk = color of the first pixel of the origin bitmap.
BT_BitmapCaptureDesktop(Row, Col, Width, Height)
Captures the desktop and returns a handle to the image bitmap captured (hBitmap).
Row, Col, Width, Height: specifies the dimensions in pixels of the rectangle to capture. For default: Row = 0, Col = 0, Width = BT_DesktopWidth(), Height = BT_DesktopHeight().
BT_BitmapCaptureWindow(Win, Row, Col, Width, Height)
Captures a specified window and returns a handle to the image bitmap captured (hBitmap).
Win: is the name (e.g. "Win1") or is the handle (e.g. hWin) of the window.
Row, Col, Width, Height: specifies the dimensions in pixels of the rectangle to capture. For default: Row = 0, Col = 0, Width = BT_WindowWidth(Win), Height = BT_WindowHeight(Win).
BT_BitmapCaptureClientArea(Win, Row, Col, Width, Height)
Captures the client area of the specified window and returns a handle to the image bitmap captured (hBitmap).
Win: is the name (e.g. "Win1") or is the handle (e.g. hWin) of the window.
Row, Col, Width, Height: specifies the dimensions in pixels of the rectangle to capture. For default: Row = 0, Col = 0, Width = BT_ClientAreaWidth(Win), Height = BT_ClientAreaHeight(Win).
BT_BitmapClipboardGet(Win)
Gets a bitmap image from the clipboard and returns a handle to the bitmap (hBitmap). If the function fails or the clipboard is empty returns zero.
Win: is the name (e.g. "Win1") or is the handle (e.g. hWin) of the window associated to opening of the clipboard.
BT_BitmapClipboardPut(Win, hBitmap)
Put a bitmap image in the clipboard. If the function fails returns FALSE (.F.), otherwise returns TRUE (.T.).
Win: is the name (e.g. "Win1") or is the handle (e.g. hWin) of the window associated to opening of the clipboard.
hBitmap: is a handle to bitmap.
BT_BitmapClipboardClean(Win)
Empties the clipboard and frees all the handles of data in the clipboard (bitmap, text, metafiles, etc.). If the function fails or the clipboard is empty returns FALSE (.F.), otherwise returns TRUE (.T.).
Win: is the name (e.g. "Win1") or is the handle (e.g. hWin) of the window associated to opening of the clipboard.
BT_BitmapClipboardIsEmpty ()
Returns TRUE (.T.) if exist a bitmap image in the clipboard, otherwise returns FALSE (.F.).