The right mouse button to adjust brightness, contr
2016-08-23
0 0 0
no vote
Other
Earn points
To adjust the brightness and contrast of the picture by the right mouse button. There are scanners code.
Adjust the contrast, brightness code is very simple. From site
Adjust the contrast, brightness code is very simple. From site
VOID CScanToDocDlg::BrightAndContrast(HBITMAP hBitmap, INT bright, INT contrast, BYTE threshold)
{
FLOAT cv = contrast <= -255? -1.0f : contrast / 255.0f;
if (contrast > 0 && contrast < 255)
cv = 1.0f / (1.0f - cv) - 1.0f;
BYTE values[256];
for (INT i = 0; i < 256; i ++)
{
INT v = contrast > 0? CheckValue(i + bright) : i;
if (contrast >= 255)
v = v >= threshold? 255 : 0;
else
v = CheckValue(v + (INT)((v - threshold) * cv + 0.5f));
values[i] = contrast < 0? CheckValue(v + bright) : v;
}
BITMAP bm;
GetObject(hBitmap, sizeof(BITMAP), &b
bmp
图片
亮度
调节
对比度
Related Source Codes
获取窗口及子控件句柄
0
0
no vote
Image cropping and compression processing on mobil
0
0
no vote
MVC Warehouse Management WMS System Source Code
0
0
no vote
bmp2video
0
0
no vote
VC port operation module
0
0
no vote
No comment