THPDFPage.SetGrayColor

THPDFPage

 

Oben  Zurück  Weiter

Legt Füll- und Strichfarben fest

 

Delphi-Syntax:

procedure SetGrayColor ( GrayColor: Extended );

 

C++-Syntax:

void __fastcall SetGrayColor ( Extended GrayColor);

 

Beschreibung:

Der Aufruf von SetGrayColor legt die Werte für Füll- und Strichfarben fest. Diese Funktion entspricht dem Aufruf der beiden Funktionen SetGrayFillColor und SetGrayStrokeColor mit demselben Wert

GrayColor-Wert von 0 (Schwarz) bis 1 (Weiß)

 

Code-Beispiel

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.

 

Siehe auch: SetGrayFillColor, SetGrayStrokeColor, SetRGBColor, SetRGBFillColor, SetRGBStrokeColor