drawtobitmap

DrawToBitmap returning blank image

孤街醉人 提交于 2019-11-26 11:40:12
问题 I have a problem on creating bitmap image out of my winform application. Situation: I have a UserControl named as \" CanvasControl \" that accepts OnPaint method acting as canvas for my Draw Pad application. Inside this user control I have a function \" PrintCanvas() \" that will create a screenshot image of the UserControl into PNG file. Below is the PrintCanvas() function: public void PrintCanvas(string filename = \"sample.png\") { Graphics g = this.CreateGraphics(); //new bitmap object to