mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Merge revision 643 and revision 648 changes:
- Improve the cefclient transparency test by adding the ability to view individual pixel values (issue #584). - Change cefclient off-screen rendering example to account for premultiplied alpha values (issue #584). git-svn-id: https://chromiumembedded.googlecode.com/svn/branches/1025@649 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@ -466,6 +466,22 @@ LRESULT CALLBACK PluginWndProc(HWND hWnd, UINT message, WPARAM wParam,
|
||||
lastMousePos.x = curMousePos.x = LOWORD(lParam);
|
||||
lastMousePos.y = curMousePos.y = HIWORD(lParam);
|
||||
mouseRotation = true;
|
||||
} else if (wParam & MK_CONTROL) {
|
||||
// Retrieve the pixel value.
|
||||
int x = LOWORD(lParam);
|
||||
int y = HIWORD(lParam);
|
||||
unsigned char r, g, b, a;
|
||||
if (plugin->renderer.GetPixelValue(x, y, r, g, b, a)) {
|
||||
std::stringstream ss;
|
||||
ss << x << "," << y << " = R:" << static_cast<int>(r) << " G:" <<
|
||||
static_cast<int>(g) << " B:" << static_cast<int>(b);
|
||||
if (plugin->renderer.IsTransparent())
|
||||
ss << " A:" << static_cast<int>(a);
|
||||
|
||||
std::string js =
|
||||
"document.getElementById('pixel').innerText = '" + ss.str() + "';";
|
||||
AppGetBrowser()->GetMainFrame()->ExecuteJavaScript(js, "", 0);
|
||||
}
|
||||
} else {
|
||||
if (g_offscreenBrowser.get()) {
|
||||
g_offscreenBrowser->SendMouseClickEvent(LOWORD(lParam), HIWORD(lParam),
|
||||
|
Reference in New Issue
Block a user