Click here to Skip to main content
15,889,216 members
Home / Discussions / C#
   

C#

 
GeneralWebServices and singleton pattern Pin
yarns27-Feb-08 8:34
yarns27-Feb-08 8:34 
GeneralRe: WebServices and singleton pattern Pin
led mike27-Feb-08 8:49
led mike27-Feb-08 8:49 
GeneralRe: WebServices and singleton pattern Pin
yarns27-Feb-08 8:51
yarns27-Feb-08 8:51 
GeneralRender loop for other process Pin
Jitse27-Feb-08 8:24
Jitse27-Feb-08 8:24 
GeneralRe: Render loop for other process Pin
Dave Kreskowiak27-Feb-08 10:07
mveDave Kreskowiak27-Feb-08 10:07 
GeneralRe: Render loop for other process Pin
Jitse28-Feb-08 3:47
Jitse28-Feb-08 3:47 
GeneralRe: Render loop for other process Pin
Dave Kreskowiak28-Feb-08 14:44
mveDave Kreskowiak28-Feb-08 14:44 
GeneralRe: Render loop for other process Pin
Jitse29-Feb-08 9:33
Jitse29-Feb-08 9:33 
Quote: "The best you're going to be able to do is draw a small window covering just what you want, but you will not be able to "see through it"." - By Dave Kreskowiak

Seems you were wrong. Wink | ;)

Credit goes to Rui Godinho Lopes. This is the most important piece of code, works with with the user32.dll UpdateLayeredWindow function. Link is at the bottom.
<br />
        public void SetBitmap(Bitmap bitmap)<br />
        {<br />
            IntPtr screenDC = Win32.GetDC(IntPtr.Zero);<br />
            IntPtr memoryDC = Win32.CreateCompatibleDC(screenDC);<br />
<br />
            IntPtr gdiBitmap = IntPtr.Zero;<br />
            IntPtr emptyBitmap = IntPtr.Zero;<br />
<br />
            try<br />
            {<br />
                gdiBitmap = bitmap.GetHbitmap();<br />
                emptyBitmap = Win32.SelectObject(memoryDC, gdiBitmap);<br />
<br />
                Win32.Point pointSource = new Win32.Point(0, 0);<br />
                Win32.Point topPos = new Win32.Point(_form.Left, _form.Top);<br />
                Win32.Size size = new Win32.Size(bitmap.Width, bitmap.Height);<br />
                Win32.BLENDFUNCTION blendFunc = new Win32.BLENDFUNCTION();<br />
                blendFunc.AlphaFormat = Win32.AC_SRC_ALPHA;<br />
                blendFunc.BlendFlags = 0;<br />
                blendFunc.BlendOp = Win32.AC_SRC_OVER;<br />
                blendFunc.SourceConstantAlpha = 255; // TODO: TEMP<br />
<br />
                Win32.UpdateLayeredWindow(<br />
                    _form.Handle,<br />
                    screenDC,<br />
                    ref topPos,<br />
                    ref size,<br />
                    memoryDC,<br />
                    ref pointSource,<br />
                    0,<br />
                    ref blendFunc,<br />
                    Win32.ULW_ALPHA);<br />
            }<br />
            finally<br />
            {<br />
                Win32.ReleaseDC(IntPtr.Zero, screenDC);<br />
                if (gdiBitmap != IntPtr.Zero)<br />
                {<br />
                    Win32.SelectObject(memoryDC, emptyBitmap);<br />
                    Win32.DeleteObject(gdiBitmap);<br />
                }<br />
                Win32.DeleteDC(memoryDC);<br />
            }<br />


Here's the link: CodeProject: Per Pixel Alpha Blend in C#[^]
GeneralRe: Render loop for other process Pin
Dave Kreskowiak29-Feb-08 18:28
mveDave Kreskowiak29-Feb-08 18:28 
GeneralRe: Render loop for other process Pin
Jitse1-Mar-08 2:10
Jitse1-Mar-08 2:10 
GeneralRe: Render loop for other process Pin
Dave Kreskowiak1-Mar-08 14:45
mveDave Kreskowiak1-Mar-08 14:45 
GeneralRe: Render loop for other process Pin
Jitse2-Mar-08 2:23
Jitse2-Mar-08 2:23 
QuestionUsing System.Reflection to walk values in an array??? Pin
LongRange.Shooter27-Feb-08 8:08
LongRange.Shooter27-Feb-08 8:08 
GeneralRe: Using System.Reflection to walk values in an array??? Pin
buchstaben27-Feb-08 8:18
buchstaben27-Feb-08 8:18 
GeneralRe: Using System.Reflection to walk values in an array??? Pin
LongRange.Shooter27-Feb-08 8:32
LongRange.Shooter27-Feb-08 8:32 
GeneralRe: Using System.Reflection to walk values in an array??? Pin
buchstaben27-Feb-08 8:42
buchstaben27-Feb-08 8:42 
GeneralRe: Using System.Reflection to walk values in an array??? Pin
LongRange.Shooter27-Feb-08 12:15
LongRange.Shooter27-Feb-08 12:15 
Generalvs 2003 debugger issue Pin
robustm27-Feb-08 7:53
robustm27-Feb-08 7:53 
AnswerRe: vs 2003 debugger issue Pin
buchstaben27-Feb-08 7:59
buchstaben27-Feb-08 7:59 
GeneralSystem.io.Directory.GetFiles Pin
George Luttrell27-Feb-08 7:45
George Luttrell27-Feb-08 7:45 
GeneralRe: System.io.Directory.GetFiles Pin
buchstaben27-Feb-08 7:51
buchstaben27-Feb-08 7:51 
GeneralRe: System.io.Directory.GetFiles Pin
George Luttrell28-Feb-08 3:43
George Luttrell28-Feb-08 3:43 
GeneralRe: System.io.Directory.GetFiles Pin
buchstaben28-Feb-08 3:49
buchstaben28-Feb-08 3:49 
GeneralRe: System.io.Directory.GetFiles Pin
George Luttrell28-Feb-08 13:43
George Luttrell28-Feb-08 13:43 
GeneralTrapping a Keystroke Pin
MarkMokris27-Feb-08 6:30
MarkMokris27-Feb-08 6:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.