|
设置填充和描边颜色
Delphi 语法:
procedure SetGrayColor ( GrayColor: Extended );
C++ 语法:
void __fastcall SetGrayColor ( Extended GrayColor);
说明:
调用 SetGrayColor 设置填充和描边颜色值。此函数等同于同时调用两个函数 以相同值调用 SetGrayFillColor 和 SetGrayStrokeColor
GrayColor 的取值范围为 0(黑色)到 1(白色)
代码示例
program Rectangle;
{$APPTYPE CONSOLE}
uses
SysUtils, Graphics, Classes, HPDFDoc;
var
HPDF: THotPDF;
begin
HPDF := THotPDF.Create(nil);
try
HPDF.AutoLaunch := true; // PDF file will be shown automatically
HPDF.FileName := '\Rectangle.pdf'; // Set PDF filename
HPDF.BeginDoc; // Create PDF file
HPDF.CurrentPage.SetGrayColor ( 0.525 ); // Set gray color
HPDF.CurrentPage.Rectangle( 10, 10, 100, 100 ); // Draw rectangle
HPDF.CurrentPage.FillAndStroke; // and fill and stroke
HPDF.EndDoc; // Close PDF file
finally
HPDF.Free;
end;
end.
另请参阅: SetGrayFillColor, SetGrayStrokeColor, SetRGBColor, SetRGBFillColor, SetRGBStrokeColor.
|