Upload Code
loading-left
loading loading loading
loading-right

Loading

Profile
No self-introduction
codes (1)
The right mouse button to adjust brightness, contr
no vote
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 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
zzjking
2016-08-23
0
1
No more~