THotPDF.RegisterFreeFormGouraudShading Metodo

Valore restituito: un nome pattern generato automaticamente (Sh1, Sh2, ...) registrato nel dizionario Resources/Pattern della pagina corrente. Restituisce una stringa vuota quando StrictVersionLock e attivo e la Version attiva e inferiore a PDF 1.3 (altrimenti la versione documento viene aggiornata automaticamente a 1.3)

 

Example di codice

// Four-corner colour quad split into two independent triangles
// along the top-left -> bot-right diagonal. The colours blend
// smoothly across the mesh; the diagonal is the ridge where the
// two triangles meet
//
//   top-left red    -- top-right green
//        |                  |
//   bot-left blue   -- bot-right yellow
var
  Doc: THotPDF;
  PatName: AnsiString;
  Verts: array[0..29] of Extended;
  H, XMin, YMin, XMax, YMax: Single;
begin
  Doc := THotPDF.Create(nil);
  try
    Doc.Version := pdf14;
    Doc.BeginDoc;
    H := Doc.CurrentPage.Height;
    XMin := 0; YMin := H - 200; XMax := 200; YMax := H;
    // triangle A: top-left red, top-right green, bot-right yellow
    Verts[ 0] := XMin; Verts[ 1] := YMax; Verts[ 2] := 1.0; Verts[ 3] := 0.0; Verts[ 4] := 0.0;
    Verts[ 5] := XMax; Verts[ 6] := YMax; Verts[ 7] := 0.0; Verts[ 8] := 1.0; Verts[ 9] := 0.0;
    Verts[10] := XMax; Verts[11] := YMin; Verts[12] := 1.0; Verts[13] := 1.0; Verts[14] := 0.0;
    // triangle B: top-left red, bot-right yellow, bot-left blue
    Verts[15] := XMin; Verts[16] := YMax; Verts[17] := 1.0; Verts[18] := 0.0; Verts[19] := 0.0;
    Verts[20] := XMax; Verts[21] := YMin; Verts[22] := 1.0; Verts[23] := 1.0; Verts[24] := 0.0;
    Verts[25] := XMin; Verts[26] := YMin; Verts[27] := 0.0; Verts[28] := 0.0; Verts[29] := 1.0;
    PatName := Doc.RegisterFreeFormGouraudShading(
      XMin, YMin, XMax, YMax, 3, Verts);
    Doc.CurrentPage.SetFillPattern(PatName);
    Doc.CurrentPage.Rectangle(0, 0, 200, 200);
    Doc.CurrentPage.Fill;
    Doc.EndDoc;
  finally
    Doc.Free;
  end;
end;

 

Vedi anche

RegisterDeviceN, RegisterSeparation, RegisterLabColorSpace, Version, Supporto dei filtri PDF