.net - Can't save panel with controls to bitmap -
i have been googling behind off morning trying figure out.
i have panel multiple labels, picturebox , background image. want save whole panel bitmap printing, however, draws panel , background image. none of labels or picture box being draw.
here code
private sub button4_click(sender object, e eventargs) handles button4.click dim bmp new bitmap(jobcard.panel1.width, jobcard.panel1.height) jobcard.panel1.drawtobitmap(bmp, new rectangle(0, 0, bmp.width, bmp.height)) if savefiledialog1.showdialog = windows.forms.dialogresult.ok bmp.save(savefiledialog1.filename) end if end sub
anyone know cause this? p.s, using visual studio express 2012
edit : got working partly of mou below. forgot show form before tried save panel bitmap. form hidden didn't notice
try this
bitmap bmp = new bitmap(panel1.width,panel1.height); panel1.drawtobitmap(bmp, panel1.bounds); bmp.save(@"c:\temp\test.bmp");
got tips url how can save panel in form picture?
i test , worked fine. here image of panel generated programmatically.
Comments
Post a Comment