资 源 简 介
通过鼠标右键来调节图片的亮度和对比度。里面有扫描仪程序代码。调节对比度,亮度的代码很简单。来源于网站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), &bm ); LPARGBQuad o,p; for (UINT y = 0; y < bm.bmHeight; y ++, p+=nRowPadding, o+=nRowPadding) {
文 件 列 表
ScanToDoc
res
Convert.cpp
Convert.h
DIB.cpp
DIB.h
PING.cpp
ping.h
PingThread.cpp
PingThread.h
QueryDlg.cpp
QueryDlg.h
ReadMe.txt
resource.h
ScanToDoc.aps
ScanToDoc.rc
ScanToDoc.vcxproj
ScanToDoc.vcxproj.filters
ScanToDoc.vcxproj.user
ScanToDocApp.cpp
ScanToDocApp.h
ScanToDocDlg.cpp
ScanToDocDlg.h
stdafx.cpp
stdafx.h
targetver.h
twain.h
TwainCpp.cpp
TwainCpp.h
MM.bmp
ScanToDoc.v11.suo