THPDFPage.SetGrayColor

THPDFPage

 

Haut  Précédent  Suivant

Sets fill and stroke colors.

 

Syntaxe Delphi :

procedure SetGrayColor ( GrayColor: Extended );

 

Syntaxe C++ :

void __fastcall SetGrayColor ( Extended GrayColor);

 

Description:

Call SetGrayColor sets fill and stroke colors value. This function is equivalent to call two function SetGrayFillColor and SetGrayStrokeColor with same value.

Valeur GrayColor de 0 (noir) à 1 (blanc)

 

Exemple de code

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.

 

Voir aussi: SetGrayFillColor, SetGrayStrokeColor, SetRGBColor, SetRGBFillColor, SetRGBStrokeColor.