nasiel som na nete kod pre tlacenie s vytvoreneho programu, ale len priklad:
Kód:
void __fastcall TForm1::SpeedButton1Click(TObject *Sender)
{
if (PrintDialog1->Execute())
{
unsigned int BodyX, BodyY;
Printer()->BeginDoc();
BodyX = GetDeviceCaps(Printer()->Canvas->Handle, LOGPIXELSX);
BodyY = GetDeviceCaps(Printer()->Canvas->Handle, LOGPIXELSY);
Printer()->Canvas->TextOut(((float) 100/Screen->PixelsPerInch * BodyX), ((float) 100/Screen->PixelsPerInch * BodyY), "text") ;
Printer()->EndDoc();
}
}
chcel som si ho upravit pre svoj program aby mi tlacilo obsak textoveho polatlacit tak som to spravil takto:
Kód:
void __fastcall TForm1::SpeedButton1Click(TObject *Sender)
{
if (PrintDialog1->Execute())
{
unsigned int BodyX, BodyY;
Printer()->BeginDoc();
BodyX = GetDeviceCaps(Printer()->Canvas->Handle, LOGPIXELSX);
BodyY = GetDeviceCaps(Printer()->Canvas->Handle, LOGPIXELSY);
Printer()->Canvas->TextOut(((float) 100/Screen->PixelsPerInch * BodyX), ((float) 100/Screen->PixelsPerInch * BodyY), (Tlacit)) ;
Printer()->EndDoc();
}
}
ale vypise mi to error:
[C++ Error] Unit1.cpp(303): E2034 Cannot convert 'TMemo *' to 'AnsiString'
[C++ Error] Unit1.cpp(303): E2342 Type mismatch in parameter 'Text' (wanted 'const AnsiString', got 'TMemo *') neveim ako to mam uprvti aby to bolo funkcne viete mi poradit?