04-22-2014 06:22 AM
Hi,
I'm using the Webbrowser ActiveX for selecting a location with Google Earth. Then I would like to make a bitmap from this control and add it as a background to a graph.
I use the functions GetCtrlDisplayBitmap and ClipboardPutBitmap but the result is not correct
Instead of that:
I get that:
Is this normal behavior? Is there a way to achieve my goal?
As a work arround I thought to make a sreen print but how can I crop the image to the part I would like to keep?
Bertrand
04-24-2014 08:29 AM
Hi,
Maybe you should try something like that (in this example, "ok_cb" is a callback function linked with any "ok button" on your user interface) :
int CVICALLBACK ok_cb (int panel, int control, int event, void *callbackData, int eventData1, int eventData2) { int bitmap = 0, plotHdl = 0; switch (event) { case EVENT_COMMIT: GetCtrlDisplayBitmap (panelHandle, PANEL_WEBBROWSER, 0, &bitmap); plotHdl = PlotBitmap (panelHandle, PANEL_GRAPH, 0.0, 0.0, 0, 0, NULL); SetCtrlBitmap (panel, PANEL_GRAPH, plotHdl, bitmap); break; } return 0; }
GetCtrlDisplayBitmap : get webbrowser image
PlotBitmap : please see the last parameter (NULL) help -> "You can pass NULL or an empty string for filename. This capability is useful when you want to define the image at a later point in your program by calling SetCtrlBitmap on the plot handle this function returns. The plot is not visible until you specify a valid image."
SetCtrlBitmap : please see the third parameter (plotHdl) help -> "For graphs, the plot handle you obtain from PlotBitmap."
04-25-2014 04:39 AM
Hi Julien,
Thank you for your suggestion.
Unfortunately we already tried your proposol and the result remains the same, the picutre in the Webbrouwser is not captured.