hi all,
i try to print in ventuz. ?
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Drawing.Printing;
namespace print
{
public partial class Print : Form
{
/// <summary>
/// 변수 선언
/// </summary>
private PrintDocument printDoc = new PrintDocument();
private PageSettings pgSettings = new PageSettings();
private PrinterSettings prtSettings = new PrinterSettings();
public Print()
{
InitializeComponent();
}
private void printPreviewBtn_Click(object sender, EventArgs e)
{
printDoc.PrinterSettings = prtSettings;
printDoc.DefaultPageSettings = pgSettings;
PrintPreviewDialog dlg = new PrintPreviewDialog();
printDoc.PrintPage += new PrintPageEventHandler(printDoc_PrintPage);
dlg.Document = printDoc;
dlg.ShowDialog();
}
private void printDoc_PrintPage(object sender, PrintPageEventArgs e)
{
String textToPrint = ".Net Printing is Easy";
Font printFont = new Font("Courier New", 40);
int leftMargin = e.MarginBounds.Left;
int topMargin = e.MarginBounds.Top;
float width = e.PageSettings.PaperSize.Width;
float height = e.PageSettings.PaperSize.Height;
// 이미지는 각자 경로로 바꿔주십시오~
Image img = Image.FromFile(@"G:\ppp.jpg");
e.Graphics.DrawImage(img, 0, 0, (int)width, (int)height);
e.Graphics.DrawString(textToPrint, printFont, Brushes.Red, 50, 100);
//throw new NotImplementedException();
}
private void printSettingBtn_Click(object sender, EventArgs e)
{
PageSetupDialog psd = new PageSetupDialog();
psd.AllowPrinter = true;
psd.AllowOrientation = true;
psd.AllowMargins = true;
psd.PageSettings = pgSettings;
psd.PrinterSettings = prtSettings;
psd.ShowDialog();
}
private void printBtn_Click(object sender, EventArgs e)
{
printDoc.PrinterSettings = prtSettings;
printDoc.DefaultPageSettings = pgSettings;
PrintDialog dlg = new PrintDialog();
dlg.Document = printDoc;
if (dlg.ShowDialog() == DialogResult.OK)
printDoc.Print();
}
}
}
Hello Ventuzians!
THE FORUMS ARE CLOSED!
Please join our discord server HERE!! << click me
We are shutting our Ventuz Forum, but don't worry, it will all be archived for you to search in if you have a query. From now on, please add all your comments, questions or observations into our Discord Server
Thanks for the great time - see you on discord!!
Dee, Karol, Daniel and the whoooole Product and Support team!
THE FORUMS ARE CLOSED!
Please join our discord server HERE!! << click me
We are shutting our Ventuz Forum, but don't worry, it will all be archived for you to search in if you have a query. From now on, please add all your comments, questions or observations into our Discord Server
Thanks for the great time - see you on discord!!
Dee, Karol, Daniel and the whoooole Product and Support team!
C sharp script help
Moderator: Support
Re: C sharp script help
Thank you.
Problem solved.
Problem solved.