2011-08-13 8 views
0

나는이 사용 :페이드 효과가 빠른 이미지를 변경하는 방법은 무엇입니까?

Dim i1 As Bitmap = owall.Clone 
    Dim i2 As New Bitmap(ChangingWP) 

    Dim g As Graphics = Graphics.FromImage(i1) 

    Dim cm As New Imaging.ColorMatrix(New Single()() { _ 
                New Single() {1, 0, 0, 0, 0}, _ 
                New Single() {0, 1, 0, 0, 0}, _ 
                New Single() {0, 0, 1, 0, 0}, _ 
                New Single() {0, 0, 0, current_alpha, 0}, _ 
                New Single() {0, 0, 0, 0, 1}}) 

    Dim ia As New Imaging.ImageAttributes 
    ia.SetColorMatrix(cm, Imaging.ColorMatrixFlag.Default, Imaging.ColorAdjustType.Bitmap) 

    g.DrawImage(i2, New Rectangle(0, 0, i2.Width, i2.Height), 0, 0, i2.Width, i2.Height, GraphicsUnit.Pixel, ia) 
    g.Dispose() 

    If increase Then 
     current_alpha += Speed 
    Else 
     current_alpha -= Speed 
    End If 

    SetWallpaper(i1, Layout) 
    If current_alpha >= 1 Then 
     current_alpha = 1 
     tmrBlend.Enabled = False 
     SetWallpaper(ChangingWP, Layout) 
    ElseIf current_alpha <= 0 Then 
     current_alpha = 0 
     tmrBlend.Enabled = False 
    End If 

을하지만 당신이 어떤 아이디어가 fast.Do되지 않는 이유는 무엇입니까? 사실, 페이드 효과가있는 배경 화면을 변경하려고합니다.

답변

-1

이미지 자체를 변경하는 대신 이미지를 표시하는 컨트롤의 Opacity 속성을 변경하는 방법은 무엇입니까?

+0

불투명도를 변경할 수있는 컨트롤이 없습니다. 문제는 코드가 winform-control의 그림이 아니라 바탕 화면의 바탕 화면을 변경하고 있다고 말합니다. – Stefan

관련 문제