用VB代码实现:)分不够再添!
最好有例子:_(

解决方案 »

  1.   

    给个简单的办法。用白色或者黑色作为蒙版进行AlphaBlend,速度也很快。
      

  2.   

    调整亮度:设AlphaFormat = &H0&,对比度可以用AlphaFormat = &H1(这是我自己的感觉,用了AlphaFormat = &H1对比度就会有变化)。你可以试试,切勿100%信赖此法
      

  3.   

    To:KiteGirl
    你有算法吗?是不是AND和XOR
      

  4.   

    比如某几个像素的亮度分别为:0 2 8 0 1
    乘4之后:
    0 8 32 0 4
    对比度增加。
    0 2 8 0 1
    加4之后:
    4 6 12 4 5
    亮度增加。还有一种是曲线乘
    0 2 8 0 10*X0 2*X2 8*X8 0*X0 1*X1对应256种亮度,乘数有256个曲线分量。先以固定乘数乘256个分量,再乘对应分量的亮度。这样则实现类似“伽玛”的亮度调整。
      

  5.   

    晚上帮你搞一下:我忙了一个学期的这些东西,现在终于有了收获了,我用的是DIB,很快的。晚上发给你啊,现在好要搞毕业论文啊。
      

  6.   

    其实啊,我觉得图象处理主要是变换的算法,你看,每一点都是由R、G、B三个基色值决定的,调整这三个值,就可以获得不同的效果,不过,我现在还只会在空间域处理,频域还不怎么会。
      

  7.   

    小仙妹的方法不对。http://www.aivisoft.net/zyl910/zDIBop.zip
      

  8.   

    谢谢thirdapple(.:RNPA:.陨落雕-鍾意吊帶MM)
      

  9.   

    Dim srcInfo As BITMAP
    GetObjectAPI picBuffer, Len(srcInfo), srcInfo
    Dim picBytes As Long
    picBytes = srcInfo.bmWidthBytes * srcInfo.bmHeight
    ReDim picOrig(1 To picBytes) As Byte
    ReDim picTemp(1 To picBytes) As ByteCall GetBitmapBits(picBuffer, picBytes, picOrig(1))
    '//主测试区
    Dim startTime As Long, b As IntegerstartTime = GetTickCount
    'lastTime = startTime
    '//Main Loop
    Do While (GetTickCount - startTime) < 4000
            b = (b + 30) Mod 200
            'Label1.Caption = srcInfo.bmWidthBytes
            Call setBnC(b - 150, 1, picBytes)
        DoEvents
        BitBltTime = BitBltTime + 20
        'PicTag.Refresh
    Loop
    PBM.Value = 26Dim DB As Single
    DB = 0.05
    Do While (GetTickCount - startTime) < 8000
            If DB < 1 Then DB = DB + 0.05 Else DB = DB + 0.3
            'Label1.Caption = srcInfo.bmWidthBytes
            Call setBnC(0, DB, picBytes)
        DoEvents
        BitBltTime = BitBltTime + 0.5
        'PicTag.Refresh
    Loop
    PBM.Value = 30
    'MsgBox BitBltTime
    End SubPrivate Sub setBnC(Brightness As Integer, DuiBi As Single, picBytes As Long)
    Dim picY As Long, tempColor As Integer
        For picY = 1 To picBytes
            tempColor = (picOrig(picY) - 128) * DuiBi + 128
            tempColor = tempColor + Brightness
            '溢出处理
            If tempColor < 0 Then
                tempColor = 0
            ElseIf tempColor > 255 Then
                tempColor = 255
            End If
            picTemp(picY) = tempColor
        Next picY
    Call SetBitmapBits(picBuffer, picBytes, picTemp(1))
    Call BitBlt(hDCdest, 0, 0, 800, 480, hDCbuffer, 0, 0, SRCCOPY)
    End SubpicBuffer是一个pictureBox的hDC,这是我的独创技术哦