Scalabium Software

SMExport/SMImport suites
Knowledge for your independence'.
Home Delphi and C++Builder tips


#45: How can I convert color value into gray-scaled color value?

If you want to convert a colored image into same gray scaled, then you must convert the color of the each pixel by the next schema:

function RgbToGray(Source: TColor) : TColor;
var Target: Byte;
begin
  Target := Round((0.30 * GetRValue(Source)) +
		(0.59 * GetGValue(Source)) +
		(0.11 * GetBValue(Source)));
  Result := RGB(Target, Target, Target);
end;


Published: November 23, 1999

See also
 
MAPIMail
ABA Picture Convert
Clarion to Text converter
SMMsg suite
SMImport suite
ABA Spreadsheet Convert
DBExport tools
Paradox Password Recovery
SMReport
Paradox ActiveX
 
 


Contact to webmaster

 

Borland Software Code Gear Scalabium Delphi tips

Copyright© 1998-2024, Scalabium Software. All rights reserved.
webmaster@scalabium.com

SMExport/SMImport suites