| |

VerySource

 Forgot password?
 Register
Search
View: 625|Reply: 2

How to print what GDI draws

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 Invalid IP Address

Post time: 2020-1-28 21:20:01
| Show all posts |Read mode
I put a PANEL on WINFORM, and then loaded a lot of controls drawn by GDI on PANEL. How can I print out the contents of this PANEL, that is, these controls drawn by GDI?
Reply

Use magic Report

0

Threads

6

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-3-17 18:00:01
| Show all posts
bmp = new Bitmap (width, height);
g = Graphics.FromImage (bmp);

g.FillRectangle (Brushes.White, 0, 0, rect.Width, rect.Height);
// The drawing method is executed once for g here
//then
bmp.Save (ms, ImageFormat.Jpeg);
Reply

Use magic Report

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 Invalid IP Address

 Author| Post time: 2020-3-23 19:30:01
| Show all posts
Thank you for giving me an idea upstairs, but the control of the GDI painting I loaded is a one-by-one report. If you ensure that the printed content and other formats are correct,
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list