Click here to Skip to main content
15,891,567 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How do you increase/decrease the brightness of a bitmap?
Posted
Updated 20-Jun-10 14:30pm
v2

1 solution

Adding a constant value to all the color components of each pixel.
The way this is done depends on the bitmap format.

There are some methods of the gdiplus::Image class that can help.
(search with google the address of the documentation)
 
Share this answer
 
Comments
Sweety Khan 21-Jun-10 2:43am    
can i do this like that

COLORREF rgb = dc.GetPixel(x, y);
BYTE r = GetRValue(rgb);
BYTE g = GetGValue(rgb);
BYTE b = GetBValue(rgb);
r+=50;
g+=50;
b+=50;
dc.SetPixel(x, y, RGB(r,g,b));
Emilio Garavaglia 21-Jun-10 3:57am    
Yes. Tht's the principle.
But may be inefficient. Better efficience can be acieved by knowing the bitmap internal format or by callig proper API (that maps to different implementation depending on the format)
Sweety Khan 21-Jun-10 7:03am    
can u please tell me the API?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900