tough nut
-
hi folks, ok, i hope i can describe this in a way that will be understandable :) so here's what i plan to do: i want to display a splash screen with an alpha channel. neither the bitmaps rectangle nor the surrounding color of my graphic should visible. i.e. i need to set the surrounding color to be drawn 100% transparent. not difficult so far. but here's the tough part. namely, i want the splash screen to appear like it comes from nowhere. it should start with a opacity of 0% (i.e. 100% transparence) and within a few seconds it should become more and more visible until it has a final opacity of 100%. confused ? me too ;) i'm only able to display the graphic without the surrounding stuff (alpha value) when the graphics opacity is set to 100%. but when it comes to the piont where i need to set the opacity to a lower value and still want to make the surrounding color of my graphic completely invisible i'm starting to freak out. i don't know how to achieve this. i would be very glad about some hints ... any hints :wtf: thanks in advance.
-
hi folks, ok, i hope i can describe this in a way that will be understandable :) so here's what i plan to do: i want to display a splash screen with an alpha channel. neither the bitmaps rectangle nor the surrounding color of my graphic should visible. i.e. i need to set the surrounding color to be drawn 100% transparent. not difficult so far. but here's the tough part. namely, i want the splash screen to appear like it comes from nowhere. it should start with a opacity of 0% (i.e. 100% transparence) and within a few seconds it should become more and more visible until it has a final opacity of 100%. confused ? me too ;) i'm only able to display the graphic without the surrounding stuff (alpha value) when the graphics opacity is set to 100%. but when it comes to the piont where i need to set the opacity to a lower value and still want to make the surrounding color of my graphic completely invisible i'm starting to freak out. i don't know how to achieve this. i would be very glad about some hints ... any hints :wtf: thanks in advance.
Some ideas: 1: Do a screen grab of the area your splash screen will cover. In memory use the grabbed bitmap as the background, draw your splash screen on it. Blit that bitmap to the screen. Not true transparency, but it will appear that way to the user. 2: Use a window region (HRGN) that corresponds to the opaque part of your splash screen.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04 "There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05 Within you lies the power for good - Use it!
-
hi folks, ok, i hope i can describe this in a way that will be understandable :) so here's what i plan to do: i want to display a splash screen with an alpha channel. neither the bitmaps rectangle nor the surrounding color of my graphic should visible. i.e. i need to set the surrounding color to be drawn 100% transparent. not difficult so far. but here's the tough part. namely, i want the splash screen to appear like it comes from nowhere. it should start with a opacity of 0% (i.e. 100% transparence) and within a few seconds it should become more and more visible until it has a final opacity of 100%. confused ? me too ;) i'm only able to display the graphic without the surrounding stuff (alpha value) when the graphics opacity is set to 100%. but when it comes to the piont where i need to set the opacity to a lower value and still want to make the surrounding color of my graphic completely invisible i'm starting to freak out. i don't know how to achieve this. i would be very glad about some hints ... any hints :wtf: thanks in advance.
Did you try the
AlphaBlend
function... This will help you... http://www.codeproject.com/gdi/alphablend.asp[^]Jesus Loves:rose:
--Owner Drawn:rose: --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord:rose:
-
Some ideas: 1: Do a screen grab of the area your splash screen will cover. In memory use the grabbed bitmap as the background, draw your splash screen on it. Blit that bitmap to the screen. Not true transparency, but it will appear that way to the user. 2: Use a window region (HRGN) that corresponds to the opaque part of your splash screen.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04 "There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05 Within you lies the power for good - Use it!
nice idea, actually. and i've already tried it. there is just one problem. the graphic i want to show is not rectangular (neither elliptic) it's a custom hand drawn one. so if i draw my splash on the background image and make it slightly transparent the whole graphic (including the surrounding alpha color) will be visible on it. you understand ? but the alpha color should be complete invisible during the entire appearance procedure.
-
Did you try the
AlphaBlend
function... This will help you... http://www.codeproject.com/gdi/alphablend.asp[^]Jesus Loves:rose:
--Owner Drawn:rose: --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord:rose:
yeah. i use it already. AlphaBlend and SetLayeredWindowAttributes are the two main functions with those i'm trying to get this done. But they don't last out.
-
yeah. i use it already. AlphaBlend and SetLayeredWindowAttributes are the two main functions with those i'm trying to get this done. But they don't last out.
Take a look at the sample...
Jesus Loves:rose:
--Owner Drawn:rose: --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord:rose:
-
Take a look at the sample...
Jesus Loves:rose:
--Owner Drawn:rose: --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord:rose:
selecting rectangular bitmaps and AlphaBlending them is not my problem. i need to get it done with non-rectangular bitmaps.
-
nice idea, actually. and i've already tried it. there is just one problem. the graphic i want to show is not rectangular (neither elliptic) it's a custom hand drawn one. so if i draw my splash on the background image and make it slightly transparent the whole graphic (including the surrounding alpha color) will be visible on it. you understand ? but the alpha color should be complete invisible during the entire appearance procedure.
Use an intermediate step. Use two memory bitmaps containing the background image. On one draw your splash screen with TransparentBlt() (Image is 100% opaque, alpha colour 100% transparent), then draw that image at the transparency you want onto the second bitmap. Because the "transparent" parts are the same colour the alpha blending will appear transparent. As for the window region idea, you should be able to adapt the code found at http://www.codeproject.com/buttonctrl/irregular_buttons.asp[^] to create the reguired window region for your splash screen.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04 "There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05 Within you lies the power for good - Use it!
-
selecting rectangular bitmaps and AlphaBlending them is not my problem. i need to get it done with non-rectangular bitmaps.
You've got to use
SetWindowRegion
andAlphaBlend
together.Jesus Loves:rose:
--Owner Drawn:rose: --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord:rose:
-
selecting rectangular bitmaps and AlphaBlending them is not my problem. i need to get it done with non-rectangular bitmaps.
This one is all about Alpha Blending of non-rectangular bitmaps http://www.codeproject.com/miscctrl/csplashscreenex.asp[^]
Jesus Loves:rose:
--Owner Drawn:rose: --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord:rose:
-
This one is all about Alpha Blending of non-rectangular bitmaps http://www.codeproject.com/miscctrl/csplashscreenex.asp[^]
Jesus Loves:rose:
--Owner Drawn:rose: --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord:rose:
yesss that's it! thanks a lot!! ... AnimateWindow was completely new to me :doh: