문제

Is there a way to get a screenshot of a glade/gtkbuilder UI xml by code (preferrably C)?

도움이 되었습니까?

해결책

You have to create a window and display it in the ordinary way. There is no way to do it "just for show", so to say. For GTK 2 you also have to display the window (make it visible on screen) and then make a screenshot of it. In GTK 3 (which doesn't support the old glade format, just the newer gtkbuilder one) it is possible to render to memory. So theoretically it should be possible to just render the window and save it to a file without involving X (or any other particular back end).

There are pictures of all widgets in the manual for GTK (which is included in the source release). I don't know for sure, but perhaps they are automatically generated in some way. It might be worth looking into.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top