Dobrý !
Chcel by som vedieť ako by ste nastavili vytlačiť neaký obrázok napr: tabuľku a do tej tabuľky vložiť neaký text ???
Lebo viem iba že vám vytlačí po riadkoch text ako napr:
meno:...
priezvisko:.....
mesto:....
.
.
Ale neviem ako skombinovať tabuľku s textom ??? Aby ten text bol v tabuľke ?
Neviete mi niekto pomôcť ?
Hľadal som aj na googli ale nenašiel som nič kde by kombinoval text s neakov tabuľkou ?
Za radu ďakujem .
Fórum › .NET
Vytlačiť nakreslený obrázok z textom

Prosím napsat problém ještě jednou a srozumitelně:-) Obrázek je obrázek, tabulka je tabulka. Větu "vytlačiť neaký obrázok napr: tabuľku" prostě nechápu. Chvíli mluvíš o nějakém obrázku, pak o tabulce a pak o psaní do tabulky...
Sorri !
Tak to ukážem na príklade :
Máš vo forme vložení 1 textbox a jeden button . Do to texboxu napíšeš neaký text . Potom stlačíš ten button a ten ti zobrazí nastavenia pri tlači . Dáš vytlačiť a ten text z texboxu ti orámikuje taký čierny obĺžnik . a ten text v tom čierny obĺžniku
neviem urobyť ??
Za dadu veľmi ďakujem :)
Umíš nakreslit obdélník? Umíš nakreslit text? Výborně. Jediné, co potřebuješ, je vědět, jaké rozměry má danej text (to se dá zjistit, název metody neznám).
no nakreslím obdlžnik a naraz pod to zadám text
1. Ako zistim tú veľkosť toho textu ???
2. Ako dostanem ten text do toho obdĺžníka ???
Lebo nakreslím obdĺžnik a potom dám text a mi to napíše po obdĺžnik !!
Dík :)
A ešte k tomu tlsčeniu :
Ako mám to vytlačiť?
No mám urobené :
private void tiskClick(object sender, EventArgs e)
{
PageSetupDialog psd = new PageSetupDialog();
System.Drawing.Printing.PrintDocument pd = new System.Drawing.Printing.PrintDocument();
psd.Document = pd;
psd.PageSettings = pd.DefaultPageSettings;
if (psd.ShowDialog() == DialogResult.OK)
{
tiskDialog.ShowDialog();
}
}
private void tiskStranky(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
Graphics grafika = this.CreateGraphics();
Pen penl = new Pen(Color.Black, 1.0f);
grafika.DrawLine(penl, 4, 0, 100, 100);
grafika.DrawRectangle(penl, 40, 40, 180, 40);
grafika.DrawEllipse(penl, 100, 100, 50, 40);
grafika.DrawEllipse(penl, 20, 100, 200, 200);
grafika.DrawString("Vytajte C#", new Font("Verdana", 20),new SolidBrush(Color.Tomato), 40, 40);
}
Normálne vybehne tabuľka s nastavením o tlači a ked dáš tlačiť tak ti nevitlačí nič !!
Neviete pomôcť
Zaradu ďakujem
Už som na to prišiel :)
Tu je to :
private void tiskStranky(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
Graphics grfx = e.Graphics;
Font font = new Font("Arial", 400);
StringFormat strfmt = new StringFormat();
strfmt.Alignment = StringAlignment.Center;
strfmt.LineAlignment = StringAlignment.Center;
// Nastavíme pravoúhelník pro tisk:
RectangleF rect = grfx.VisibleClipBounds;
Pen penl = new Pen(Color.Black, 1.0f);
grfx.DrawLine(penl, 4, 0, 100, 100);
grfx.DrawRectangle(penl, 40, 40, 180, 40);
grfx.DrawEllipse(penl, 100, 100, 50, 40);
grfx.DrawEllipse(penl, 20, 100, 200, 200);
grfx.DrawString("Vytajte C#", new Font("Verdana", 20), new SolidBrush(Color.Tomato), 40, 40);
grfx.DrawRectangle(penl, 0, 0, 1700, 600);
}
a ešte som vyriešil aj okraje :
private void TlactiClik(object sender, EventArgs e)
{
PageSetupDialog psd = new PageSetupDialog();
System.Drawing.Printing.PrintDocument pd = new System.Drawing.Printing.PrintDocument();
psd.Document = pd;
psd.PageSettings = pd.DefaultPageSettings;
if (psd.ShowDialog() == DialogResult.OK)
{
DialogResult vyberaneTlacitko = tiskDialog.ShowDialog();
if (vyberaneTlacitko.Equals(DialogResult.OK))
{
tiskDokumentu.Print();
}
}
}
už my treba iba zisti ako nastaviť taký veľký rámik aký je dlhý text ?? toto nemám šajm ako urobiť ?
Pomôžte

Přidej příspěvek
Ano, opravdu chci reagovat → zobrazí formulář pro přidání příspěvku
×Vložení zdrojáku
×Vložení obrázku
×Vložení videa
































Uživatelé prohlížející si toto vlákno
Podobná vlákna
Problém s textom na stránke — založil w3q
BOOST - pohodlnejsia a lepsia praca s textom — založil sn3d
Obrazok — založil IgIhu
Premenovať obrazok — založil Michal115
Moderátoři diskuze