LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

ClipboardPutBitmap and Webbrowser

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:

Picture 1.jpg

 

I get that:

Picture 2.jpg

 

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

0 Kudos
Message 1 of 3
(4,498 Views)

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."

0 Kudos
Message 2 of 3
(4,469 Views)

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.

0 Kudos
Message 3 of 3
(4,461 Views)