c# - Take screendump from menu but it stays open thus in the picture -
i have feature in program user can make screendump of main form. user must menu select file | take screendump. works. however, dropdown menu remains open , partially visible when screendump taken. other controls on top of though. how can ensure dropdown closed before screenshot taken?
i have tried include hidedropdown() on both menu , menu item neither helps. have tried make entire menu invisible no luck either.
private void toolstripmenuitem_screendumpprogram_click(object sender, eventargs e) { ... hidedropdown() ... various tests bitmap screendump = new bitmap(width, height); graphics gfx = graphics.fromimage(screendump); gfx.copyfromscreen(location, point.empty, size); screendump.save("myscreenshot.png", imageformat.png); } any ideas how avoid issue?
i think need not screenshot rendering of form bitmap. this has been done before. other solutions available using search.
Comments
Post a Comment