2.1.12.1 adjust_image_brightness
Description
adjust the brightness of image contained in MatrixObject
adjust the brightness of image contained in MatrixObject
Syntax
int adjust_image_brightness( MatrixObject & mo, int adjust )
int adjust_image_brightness( BITMAPHANDLE * pLBmp, int adjust )
Parameters
- mo
- [modify] the image need to adjust.
- adjust
- [input] adjust value of brightness.
- pLBmp
- [modify] the image handler need to adjust.
- adjust
- [input] adjust value of brightness.
Return
SUCCESS or a LeadTools error number less than zero.
SUCCESS or a LeadTools error number less than zero.
Examples
Prior to compilation, load matdata_utils.c to the workspace by executing the following LabTalk command:
Run.LoadOC("Originlab\matdata_utils.c", 16);
To retain matdata_utils.c in the workspace for successive sessions, drag and drop the file from the Temporary folder to the System folder.
EX1
#include <..\originlab\matdata_utils.h>
//this example assumes that there is already an image in the active matrixsheet in MBook1 matrixbook
void adjust_image_brightness_ex1()
{
MatrixObject mobj;
if (!mobj.Attach("MBook1"))
{
out_str("Attachment failed!");
}
int adjust = 20;
adjust_image_brightness(mobj, adjust);
}
EX2
#include <..\originlab\matdata_utils.h>
#include <image_utils.h>
//this example assumes that there is already an image in the active matrixsheet in MBook1 matrixbook
void adjust_image_brightness_ex2()
{
MatrixObject mobj;
if (!mobj.Attach("MBook1"))
{
out_str("Attachment failed!");
}
Image img(mobj);
if(!img.IsValid())
return;
BITMAPHANDLE* pLBmp = img.GetLBmp();
int adjust = 20;
adjust_image_brightness(pLBmp, adjust);
}
Remark
See Also
Header to Included
matdata_utils.h
Reference
|