THPDFPage.SetGrayColor

THPDFPage

 

Topo  Anterior  Próxima

Define as cores de preenchimento e de traço.

 

Sintaxe Delphi:

procedure SetGrayColor ( GrayColor: Extended );

 

Sintaxe C++:

void __fastcall SetGrayColor ( Extended GrayColor);

 

Description:

Chamar SetGrayColor define os valores das cores de preenchimento e de traço. Esta função é equivalente a chamar duas funções SetGrayFillColor e SetGrayStrokeColor com o mesmo valor.

Valor de GrayColor de 0( preto )  a  1( branco ).

 

Exemplo de código

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.

 

See also: SetGrayFillColor, SetGrayStrokeColor, SetRGBColor, SetRGBFillColor, SetRGBStrokeColor.