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:

kb3057839 has broken windows forms control.drawtobitmap() when called application launched windows service

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

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -