I'm working on using win api for delphi. I tried with DrawString procedure for over couple hours, but still can't get it right. Delphi keep gives me the message 'there is no overload version of 'DrawString' that can be called with these arguements'. I've tried on a form and on a custompanel to write messages...
uses
WinApi.Windows, WinApi.Messages, System.SysUtils, System.Classes, Vcl.Dialogs,
System.DateUtils,
WinApi.GDIPApi,
WinApi.GDIPObj,
Vcl.Forms, Vcl.Controls, Vcl.Graphics,
dxSkinsCore, dxSkinsDefaultPainters, cxGraphics, cxControls, cxLookAndFeels,
cxLookAndFeelPainters, cxContainer, cxEdit, cxGroupBox, cxCheckGroup,
Data.DB, SHIS.Dataset, Datasnap.DBClient, cxTextEdit, cxDBEdit,
cxImageComboBox, Vcl.Menus, cxCheckBox, Vcl.StdCtrls,
cxMaskEdit, cxDropDownEdit,
cxCheckComboBox, SHIS.Editor, cxButtons, SHIS.Ctrl, SHIS.ExtCommCdControl;
type
TCommCdF = class(TForm)
btn4: TButton;
procedure btn4Click(Sender: TObject);
private
protected
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure InitParams; override;
end;
implementation
{$R *.dfm}
uses
procedure TCommCdF.btn4Click(Sender: TObject);
var
testgraphics : TGPGraphics;
testPen : TGPPen;
testBrush : TGPSolidBrush;
testFont : TGPFont;
testFontFamily : TGPFontFamily;
begin
testgraphics := TGPGraphics.Create(SElf.Handle);
testPen := TGPPen.Create(aclBlack);
testFontFamily := TGPFontFamily.Create('Arial');
// testFont := TGPFont.Create(testFontFamily, 12, FontStyleBold, UnitPixel);
testFont := TGPFont.Create('Arial', 20);
testBrush := TGPSolidBrush.Create(aclBlack);
// testgraphics.DrawString('Hello', 5, testFont, MakeRect(0,0,50,50),testBrush);
// testgraphics.DrawString('Hello Finally', testFont, MakePoint(0, 0), testBrush);
end;