THPDFPage.SetGrayColor

THPDFPage

 

맨 위  이전  다음

Sets fill and stroke colors.

 

Delphi 구문:

procedure SetGrayColor ( GrayColor: Extended );

 

C++ 구문:

void __fastcall SetGrayColor ( Extended GrayColor);

 

Description:

SetGrayColor는 fill과 stroke 색상 값을 함께 설정합니다. 이 함수는 같은 값으로 다음 두 함수를 호출하는 것과 같습니다: 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.