Ich habs, ich habs, ich habs.
Man muss das Objekt zu erst erstellen:
Delphi-Quellcode:
procedure TFBImageEn.AddPageNumber(Number: Integer);
var
UserObjData : PUserObjData;
hObj: Integer;
begin
with ImageEnVect do
begin
hObj := AddNewObject;
New(UserObjData);
UserObjData.FIsPageNumberObj := True;
ObjUserDataLength[hObj] := sizeof(TUserObjData);
ObjUserData[hObj] := UserObjData;
// Test
UserObjData := ObjUserData[hObj];
Writeln('AddPageNumber');
Writeln(ObjUserDataLength[hObj]);
Writeln(BoolToStr(UserObjData.FIsPageNumberObj, True)); // Test OK - output is "True"
// End test
ObjFontName[hObj] := 'Tahoma';
ObjFontHeight[hObj] := -12;
ObjFontStyles[hObj] := [];
ObjPenColor[hObj] := clBlack;
ObjBrushStyle[hObj] := bsClear;
ObjMemoCharsBrushStyle[hObj] := bsClear;
ObjMemoBorderStyle[hObj] := psClear;
ObjTextEditable[hObj] := False;
ObjText[hObj] := IntToStr(Number);
ObjTop[hObj] := Height - 25;
ObjWidth[hObj] := 20;
ObjTextAlign[hObj] := iejCenter;
ObjLeft[hObj] := (Width div 2) - (ObjWidth[hObj] div 2);
//AddNewObject;
Update;
end;
end;
Das hätten sie aber ruhig mal in der Hilfe schreiben können.