hi there i’m trying to get screenshots of the plugin guis from plugin isntances.
createing component snapshot via Componenets method does not work, and a little look inside revealed why.
seems not to work for native windows.
i also tried to retrieve the handle of the vst (im workign vst/windows) and convert it to an image with. this code
VSTPluginWindow* comp = (VSTPluginWindow*)pluginWindow->getContentComponent();
int w = comp->getWidth();
int h = comp->getHeight();
HWND nativePluginWindow = comp->pluginHWND;
HDC nativePluginDC = GetDC(nativePluginWindow);
HDC hCaptureDC = CreateCompatibleDC(nativePluginDC);
HBITMAP hCaptureBitmap = CreateCompatibleBitmap(nativePluginDC, w, h);
SelectObject(hCaptureDC,hCaptureBitmap);
BitBlt(hCaptureDC,0,0,w,h,nativePluginDC,0,0,SRCCOPY);
Image * img = createImageFromHBITMAP(hCaptureBitmap);
FileOutputStream fo(File("c:\\text.png"));
PNGImageFormat png;
png.writeImageToStream(*img,fo);
fo.flush();
delete img;
ReleaseDC(nativePluginWindow,nativePluginDC);
DeleteDC(hCaptureDC);
DeleteObject(hCaptureBitmap);
no luck so far…white image :(.
any ideas how to archive this?
if it is not possible rigth now it might be good to add mehods to plugin instance for retrieving native window handle and/or image.
i’d do it and share. (windows / linux (osx maybe))
peace.

