TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Abhilash J A
534
2.4k
598.6k
How can I print each image seperately c#.net?
Jan 7 2017 11:39 AM
Hello
I want to print list of images from list as shown below,
I have tried,
On button click,
int
currentPage;
ArrayList ListViewItemsData =
new
ArrayList() { };
private void btn_click(object sender, MouseButtonEvertArgs e)
{
PrintDocument pd =
new
PrintDocument();
pd.PrintPage +=
new
PrintPageEventHandler(PrintImageHandler);
System.Windows.Forms.PrintDialog pdi =
new
System.Windows.Forms.PrintDialog();
pdi.Document = pd;
if
(pdi.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
pd.Print();
}
}
private
void
PrintImageHandler(
object
sender, PrintPageEventArgs ppeArgs)
{
Graphics g = ppeArgs.Graphics;
System.Drawing.Image objimage = System.Drawing.Image.FromFile(ListViewItemsData[currentPage].ToString());
g.DrawImage(objimage, 50, 50, objimage.Width, objimage.Height);
currentPage++;
if
(currentPage < ListViewItemsData.Count)
{
objimage = System.Drawing.Image.FromFile(ListViewItemsData[currentPage].ToString());
g.DrawImage(objimage, 100, 300, objimage.Width, objimage.Height);
currentPage++;
}
ppeArgs.HasMorePages = currentPage < ListViewItemsData.Count;
}
How can I do this? Please help me.
Reply
Answers (
10
)
where we use multithreading in real time application
some invalid argument in system.drawing.graphics c#