Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
picScreen or map question
#1
Ok I pretty much got alpha blending working.. I got 2 pixboxes that will blend together. I want to now have it do it with the picScreen... or the map.

Code:
Private Sub hsAlphaBlend_Change()
'    picTest.Picture = picChat.Picture
    
    With BF
        .BlendOp = AC_SRC_OVER
        .BlendFlags = 0
        .SourceConstantAlpha = 155
        .AlphaFormat = 0
    End With

    RtlMoveMemory lBF, BF, 4
    
    AlphaBlend picMainMenu.hdc, 0, 0, picMainMenu.ScaleWidth, picMainMenu.ScaleHeight, picScreen.hdc, 0, 0, picMainMenu.ScaleWidth, picMainMenu.ScaleHeight, lBF

'   picTest.Refresh
End Sub

Thats what I have. Some reason with this .. say if I have a browser up when I start the game.. my main menu is blended with the browser... I dont get why.

What do I use to mix it with the screen.... is using picScreen wrong?
Reply
#2
Grr dunno 0.0.. My alpha blending is almost working. It blends but it shows for only 1 millisecond. Waiting for someones help T.T

SAVE ME

Glimpse of the blending
[Image: AlphaGlimpse.png]

:: Pando
Reply
#3
Pando Wrote:Grr dunno 0.0.. My alpha blending is almost working. It blends but it shows for only 1 millisecond. Waiting for someones help T.T

SAVE ME

Glimpse of the blending
[Image: AlphaGlimpse.png]

:: Pando


did you put the code in the gameloop?
Reply
#4
Gilgamesch Wrote:
Pando Wrote:Grr dunno 0.0.. My alpha blending is almost working. It blends but it shows for only 1 millisecond. Waiting for someones help T.T

SAVE ME

Glimpse of the blending
[Image: AlphaGlimpse.png]

:: Pando


did you put the code in the gameloop?

Tried but it flickers.
Reply
#5
Get in contact with me... maybe if we mix some of what we both have we can get it...
Reply
#6
what are you going to do?
Reply
#7
William Wrote:what are you going to do?

What do you mean?

Heres a picture of my problem guys. It seems its copying from the computer screen not the picScreen lol...

[Image: AB.gif]
Reply
#8
What are you going to use it for? rain effect?
Reply
#9
No its for semi transparent menus. Like big time games have. Its so they can be on the screen but not completely cover it.

I just tried something else and almost got it... I might be close Smile lol
Reply
#10
okay didn't check the code. just thought the pic was cool Tongue
Reply
#11
I got it working now. I just have to have it update when I move it... it still shows the background of wher eit was.
Reply
#12
Screenshot please Smile
Reply
#13
Ok now I got it when you move it it shows something different but its still not what your right over.. I dont see why its not...

Code:
Private Sub hsAlphaBlend_Change()
    picMainMenu.Picture = picMainMenu.Picture
    
    With BF
        .BlendOp = AC_SRC_OVER
        .BlendFlags = 0
        .SourceConstantAlpha = 75
        .AlphaFormat = 0
    End With

    RtlMoveMemory lBF, BF, 4
    
    AlphaBlend picMainMenu.hdc, 0, 0, picMainMenu.ScaleWidth, picMainMenu.ScaleHeight, picScreen.hdc, picMainMenu.top, picMainMenu.Left, picMainMenu.ScaleWidth, picMainMenu.ScaleHeight, lBF

    picMainMenu.Refresh
End Sub

I updated the picture above. Its how I have it now.
Reply
#14
put something in the gameloop so its being refreshed all the time

it somehow safes whats behin dit the first time its being shown, so it needs to be refreshed
Reply
#15
Well I changed 0 and 0 which determine where to start to take the picture from...

to the Top and Left values of the Menu. I figured then it would start on picScreen there and take whats right below it. It does make it so when I move it changes but its not whats right below it.
Reply
#16
Ok my problem is just with this.

Code:
AlphaBlend frmMirage.picMainMenu.hdc, 0, 0, frmMirage.picMainMenu.ScaleWidth, frmMirage.picMainMenu.ScaleHeight, frmMirage.picScreen.hdc, frmMirage.picMainMenu.top, frmMirage.picMainMenu.Left, frmMirage.picMainMenu.ScaleWidth, frmMirage.picMainMenu.ScaleHeight, lBF

Dont I want to use Top and Left here? That gets where the start of the menu is so it can get that part of the picScreen right? Well its all off. When I move the menu up it moves over and vice versa. I figured ok then I got Top and Left mixed up. Well when I change them it doesnt alpha blend at all.

Is there something I should use instead of Top and Left? Also When the menu is near the character it does something weird. It shows the menu inside it not blended and that menu is where it should be by the character.. how the other should be. If you want a picture that explains it better.

Anyways I have it working if I can just get the positioning right.
Reply
#17
Ok I just about got it. I tried a 3rd surface to blt them too and it works fine... but of course I dont want an extra one.

The way I have it with 2 works but the thing is... some reason it shows the menu on the picscreen also so when it moves it stays solid cause its the alphablended over top of the solid one always.

THe thing I need to do is some how have it so the menu isnt on the picscreen... then it will just show the alphablended one. Anyone know how to go about this?

Code:
Private Sub hsAlphaBlend_Change()
    picMainMenu.Picture = picMainMenu.Picture
    
    With BF
        .BlendOp = AC_SRC_OVER
        .BlendFlags = 0
        .SourceConstantAlpha = 75
        .AlphaFormat = 0
    End With

    RtlMoveMemory lBF, BF, 4
    
    AlphaBlend picMainMenu.hdc, 0, 0, picMainMenu.ScaleWidth, picMainMenu.ScaleHeight, picScreen.hdc, picMainMenu.Left, picMainMenu.top, picMainMenu.ScaleWidth, picMainMenu.ScaleHeight, lBF
    
    picMainMenu.Refresh
End Sub
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)