THPDFPage.SetGrayColor

THPDFPage

 

傳回頂部  上一頁  下一頁

Sets fill and stroke colors.

 

Delphi 語法:

procedure SetGrayColor ( GrayColor: Extended );

 

C++ 語法:

void __fastcall SetGrayColor ( Extended GrayColor);

 

描述:

呼叫 SetGrayColor 會同時設定填色與描邊色,等同以相同的值呼叫兩個函式:SetGrayFillColor 與 SetGrayStrokeColor

GrayColor 值,範圍從 0(黑) 到 1(白)

 

Code Example

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.