{
MessageBox(NULL, "Cannot lock the image memory.", "Image Color Correction", MB_OK);
return FALSE;
}
for(Row = 0; Row < Height; Row++)
{
for (Col = 0; Col < Width; Col++)
{
// Get the pixel color number from Bitmap (Leadtool function).
PixelColor = L_GetPixelColor(pBitmap, Row, Col);
// Converts the large pixel color number to red, green and blue value
r = PixelColor & 0xff;
g = PixelColor / ONEBYTE;
if(g > 65535) g = 65535;
g = g & 0xff;
b = PixelColor / TWOBYTE;
if(b > 255) b = 255;
b = b & 0xff;
// Call the color algorithm
Color = ColorAlgorithm (r, g, b, red, green, blue);
// Put the pixel value into the bitmap
if(Color != PixelColor) L_PutPixelColor(pBitmap, Row, Col, Color);
}
}
GlobalUnlock(pBitmap);
return TRUE;
}
The Code in VB to use this method is:
Declare Function ModifyColorBits Lib "ColorFix" (ByRef Bitmap As LEADBitmapHandle, ByVal Height As Long, ByVal Width As Long, ByVal r As Double, ByVal g As Double, ByVal b As Double) As Boolean
Dim r As Double, g As Double, b As Double
Dim LeadHandle As LEADBitmapHandle
L_GetControlBitmap leadImage, LeadHandle
ModifyColorBits LeadHandle, leadImage.BitmapHeight, leadImage.BitmapWidth, r, g, b
L_SetControlBitmap leadImage, LeadHandle
Can any one help me to solve this problem?