Note that there are some explanatory texts on larger screens.

plurals
  1. PODrawtoBitmap not showing contents of Panel
    primarykey
    data
    text
    <p>My first post here so here goes,</p> <p>i have a program that i need to get the color of a pixel in a panel, the panel contains a IE browser as shown in the code below (I cant use a webBrowser as it doesn't load some webpages the same as IE/Firefox (usually java))</p> <pre><code> Dim TheBrowser = New SHDocVw.InternetExplorer asd = TheBrowser.HWND fgh = Me.Panel2.Handle SetParent(asd, fgh) SendMessage(asd, WM_SYSCOMMAND, SC_MAXIMIZE, 0) </code></pre> <p>This bit works Fine, however the user can change the entire forms Opacity so to get the Pixel color i found that if i use DrawtoBitmap on the Form it ignores the Opacity, so i can use this to get the pixel color, however the drawtobitmap is leaving the contents of the Panel blank (I've used a picturebox to test the image)</p> <pre><code> Dim mybitmap As New Bitmap(Me.Width, Me.Height) Me.DrawToBitmap(mybitmap, Me.ClientRectangle) PictureBox1.BackgroundImage = mybitmap </code></pre> <p>the form and all its buttons etc are shown fine on the picturebox but the panel is blank (Ive all tried to convert just the Panel to a bitmap to but that comes out completely blank). Am i linking the IE to the Panel incorrectly or is it just DrawtoPanel not working right? (I tried using Printscreen but as expected it includes the Opacity). heres my Sendmessage and Setparent just for completness.</p> <pre><code>&lt;DllImport("user32.dll")&gt; _ Private Shared Function SendMessage(ByVal hWnd As IntPtr, ByVal Msg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer End Function &lt;DllImport("user32.dll")&gt; _ Public Shared Function SetParent(ByVal HWNDChild As IntPtr, ByVal HWNDNewParent As IntPtr) As IntPtr End Function </code></pre> <p>Any help would be greatly appreciated, Thanks Ryan</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload