I have been searching and searching for months for a way to get the graphics BEHIND the active form so i can do alphablended forms via png images....kinda like some of the new windows vista stuff... I know it can be done because stardock's desktopx supports png transparency and it can do it ontop of other windows...
remember, im not trying to make the form semi-transparent, im trying to make regions of the form semitransparent... so i can have semi-transparent ui's and such...
You could always just set the Form's Transparency key to a known color in your background bitmap.
OR
Assign a custom-shaped region to your form's region property. both can be done without api and give good results (the region one is better because you don't get the form's border in the way). I havent got any code though.
I dont think you quite understand what im trying to do... im not trying to do a transparency key... im essentially trying to alphablend a png image on to the desktop.the formborder isnt a problem cause i just set its border style to none.... this can only be accomplished if i can get the graphics for the forms underneath and alphablend the png onto that. so i probably will need to iterate through all other windows and the desktop and get their graphics properties. the only problem is i have no idea how to iterate through all the windows...
Last edited by Latin4567; Sep 3rd, 2005 at 07:48 PM.
and i tried hiding the form months ago.... way too much flicker and it uses way too much cpu...
I also tried looping through each pixel in the image and creating a form for each pixel which was the exact color and opacity of the specified pixel.... it works fine, except you would need a super computer to run it cause the form took an hour to load...
Last edited by Latin4567; Sep 4th, 2005 at 07:28 PM.
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
Dim d As IntPtr = New IntPtr(GetWindowDC(GetDesktopWindow))
Dim x As Graphics = Graphics.FromHdc(d)
x.DrawImage(My.Resources.alpha, Me.Location)
End Sub
the only problem is the windows below my form dont redraw when it moves so it leaves a trail.... how can i get the bellow forms to update themselves whenever my form's location changes?
no, it does not..... each pixel on the png i am using has a diffrent alpha.... so i cant just set the whole form to one opacity level... I need to literally alpha-blend pngs to the desktop.... i need to be able to use drop-shadows and smooth edges.... kinda like the windows vista stuff...
Last edited by Latin4567; Sep 5th, 2005 at 01:46 PM.
I have it in a timer...
it works, but it flickers, and if the window below has animation, it cant do it....
so back to a previous idea...
Does anyone know how to iterate through all the desktop windows and get their graphics objects... This will presumably use the GetWindow api... PLEASE HELP...
Why not use a second form to trail the mainform? If you do it by intercepting and sending Windows messages it should be pretty accurate.
"so just keep in mind that fantasy is not the same as realtiy and make sure u remember that wii sports may be fun but u cant count on it as exercise ok cool bye" - HungarianHuman
Ok I am going to use the InvalidateRect API to do it. Does anyone have a working example of how to convert values into the Long type so you can pass them to an API function>