📄 orchid_u.bas
字号:
Attribute VB_Name = "Orchid_U"
' LEUTRON VISION Orchid_U.DLL - include file for Visual Basic 5.0 and higher
' This DLL contains various useful utilities which might help with bitmap manipulations etc.
Const LVXBMP_PRESERVE_LUMINANCE = &H1
Const LVXBMP_HIGHLIGHT = &H2
Const LVXBMP_MIDTONES = &H4
Const LVXBMP_SHADOWS = &H8
Const LVXBMP_SETTINGS_BUFFER_SIZE = 1068
'--------------------------------------------------------------------------------------
' Returns the pixel value as COLORREF from a bitmap
' COLORREF in Win32 defines the colors as 0x00bbggrr
Public Declare Function lvx_BmpGetPixel Lib "Orchid_U" (ByVal pBmpInfo As Long, ByVal pBmpData As Long, _
ByVal iXPos As Long, ByVal iYPos As Long) As Long
'--------------------------------------------------------------------------------------
' Paints the bitmap in the specified window.
' The iClipFrame defines the thickness of an "invisible frame" which cuts of edges of the image.
' Set iClipFrame to 0, if you do not want to use this feature.
Public Declare Sub lvx_BmpDisplay Lib "Orchid_U" (ByVal pBmpInfo As Long, ByVal pBmpData As Long, _
ByVal hWnd As Long, ByVal iClipFrame As Long)
' the same function, but places the bitmap always to top-left corner
Public Declare Sub lvx_BmpDisplayTopLeft Lib "Orchid_U" (ByVal pBmpInfo As Long, ByVal pBmpData As Long, _
ByVal hWnd As Long, ByVal iClipFrame As Long)
'--------------------------------------------------------------------------------------
' Paints the bitmap in the specified window scaled/streched by Windows GDI to fit in the window.
' The iClipFrame defines the thickness of an "invisible frame" which reduces the size of the image.
' Set iClipFrame to 0, if you do not want to use this feature
' If bKeepAspectRatio is TRUE, the image is painted with the preserved aspect ratio, with possible
' vertical or horizontal stripes around the image in case the window dows not have its client area
' in the same aspect ratio.
Public Declare Sub lvx_BmpDisplayStretch Lib "Orchid_U" (ByVal pBmpInfo As Long, ByVal pBmpData As Long, _
ByVal hWnd As Long, ByVal iClipFrame As Long, _
ByVal bKeepAspectRatio As Long)
'--------------------------------------------------------------------------------------
' Returns the size of single line in bytes.
Public Declare Function lvx_BmpGetLineIncrement Lib "Orchid_U" (ByVal pBmpInfo As Long) As Long
'--------------------------------------------------------------------------------------
' Returns the width of the bitmap.
Public Declare Function lvx_BmpGetWidth Lib "Orchid_U" (ByVal pBmpInfo As Long) As Long
'--------------------------------------------------------------------------------------
' Returns the height of the bitmap as positive value, regardless whether the bitmap
' is top-down or bottom-up
Public Declare Function lvx_BmpGetHeight Lib "Orchid_U" (ByVal pBmpInfo As Long) As Long
'--------------------------------------------------------------------------------------
' Returns the number of bits per pixel of the bitmap.
Public Declare Function lvx_BmpGetBitCount Lib "Orchid_U" (ByVal pBmpInfo As Long) As Long
'--------------------------------------------------------------------------------------
' Returns TRUE if the bitmap is top-down oriented, or FALSE if it is bottom-up
Public Declare Function lvx_BmpIsTopDown Lib "Orchid_U" (ByVal pBmpInfo As Long) As Long
'--------------------------------------------------------------------------------------
' Reverses the order of lines, making from top-down the bottom-up or vice versa
' Changes also the height value to negative/positive
Public Declare Function lvx_BmpReverseLines Lib "Orchid_U" (ByVal pBmpInfo As Long, _
ByVal pBmpData As Long) As Long
'--------------------------------------------------------------------------------------
' Deinterlaces the bitmap by averaging each 2 lines. This function is significantly slower
' in 15/16 bit format than in 8-, 24- and 32-bit format
Public Declare Sub lvx_BmpDeinterlace Lib "Orchid_U" (ByVal pBmpInfo As Long, ByVal pBmpData As Long)
'------------------------------------------------------------------------------
' Saves the bitmap to a file.
' Does not support less than 8 bits per pixel color format.
Public Declare Function lvx_BmpSaveToFile Lib "Orchid_U" (ByVal szFileName As String, _
ByVal pBmpInfo As Long, _
ByVal pBmpData As Long) As Long
'------------------------------------------------------------------------------
' Copies the bitmap to clipboard.
' Does not support less than 8 bits per pixel color format.
Public Declare Function lvx_BmpCopyToClipboard Lib "Orchid_U" (ByVal pBmpInfo As Long, _
ByVal pBmpData As Long) As Long
'------------------------------------------------------------------------------
' Applies RGB color correction to the image. The image must be in 24-bit or 32-bit color
' format. The source image can be the same as the destination image. If it is not the
' same, the destination pDstBmpData must point to properly allocated bufer of size
' lvx_BmpGetLineIncrement * lvx_BmpGetHeight.
' iRedCorrection = value in range -50 to 50, zero means no correction in red channel
' iGreenCorrection = value in range -50 to 50, zero means no correction in green channel
' iBlueCorrection = value in range -50 to 50, zero means no correction in blue channel
' dwSettings: OR-ed combination of the following flags:
' LVXBMP_PRESERVE_LUMINANCE - the luminance of the pixel is preserved
' LVXBMP_HIGHLIGHT - color correction is applied to light pixels
' LVXBMP_MIDTONES - color correction is applied to middle-intensity pixels
' LVXBMP_SHADOWS - color correction is applied to dark pixels
' void* pSettingsBuffer - pointer to a buffer of LVXBMP_SETTINGS_BUFFER_SIZE size.
' This buffer holds calculated parameters, so that they are not needed to be
' recalculated each time the function is called.
' If this buffer is NULL, the parameters are recalculated each time the function
' is called.
Public Declare Function lvx_BmpRgbColorCorrection Lib "Orchid_U" (ByVal pBmpInfo As Long, _
ByVal pSrcBmpData As Long, _
ByVal pDstBmpData As Long, _
ByVal iRedCorrection As Long, _
ByVal iGreenCorrection As Long, _
ByVal iBlueCorrection As Long, _
ByVal dwSettings As Long, _
ByVal pSettingsBuffer As Long) As Long
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -