THPDFPage.SetRGBColor

THPDFPage

 

顶部  上一页  下一页

设置填充和描边颜色

 

Delphi 语法:

procedure SetRGBColor ( Value: TColor );

 

C++ 语法:

void __fastcall SetRGBColor ( Graphics::TColor Value );

 

说明:

Call SetRGBColor sets fill and stroke colors value. This function is equivalent to call two function SetRGBFillColor and SetRGBStrokeColor with same value.

 

代码示例

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.SetRGBColor ( clGreen );       // Set fill and stroke 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.

 

另请参阅: SetGrayColor, SetGrayFillColor, SetGrayStrokeColor, SetRGBFillColor, SetRGBStrokeColor.