c# - DrawToBitmap returns black Image from UserControl -
my first post here here goes,
i have usercontrol 30 controls (labels, textboxes etc). make "screenshot" of it. used "drawtobitmap" method usercontrol.
here samplecode
//this usercontrol 30 controls var sampleusercontrol = new sampleusercontrol(); var bmp = new bitmap(sampleusercontrol.width, sampleusercontrol.height); sampleusercontrol.drawtobitmap(bmp, sampleusercontrol.bounds);
if run code, returns me black image time. have no clue why. please help!
edit:
forgot usercontrol winforms usercontrol
this had been working me years until started returning black image last week in production. interestingly, after applied new windows patch. able find posting issue:
you didn't mention how winforms control being created, in first case winforms app launched service. there case on telerik site control instantiated server-side iis create pdf file:
http://www.telerik.com/forums/export-to-pdf-597e04c01b39
try checking patch kb3057839 , rolling short term fix. microsoft respond fix or workaround going forward.
Comments
Post a Comment