Create graphics from scratch and return them to print page events

I am working in C # .NET 3.5. I have a recipe class containing an image and some lines. I want to print these recipes, four per page. I want to write the "getprintobject" function in a class to return something to draw my document, but I'm at a dead end ...

I would like to just create and return a graphic object, but I do not see "e.graphics.drawgraphics ()". I also thought about creating a bitmap or image and returning it, but I'm not sure how to create it from scratch and get a new graphic to change it.

+3
source share
1 answer

Graphics. .

Bitmap img = new Bitmap(50, 50);
Graphics g = Graphics.FromImage(img);

, , .

+7

Source: https://habr.com/ru/post/1792251/


All Articles