我有一个图像流,176*144,格式为RGB444,没有文件头,保存在一个数组中。
dim RGB_Data() as Byte
我用描点法画图显示很慢,不知道调用API函数或其他方法快速显示在picturebox中,高手给出个例子看看,多谢了

解决方案 »

  1.   

    http://topic.csdn.net/u/20080131/12/680e83ff-5873-4eab-9217-0bf340e47ffe.html
      

  2.   

    自己创建DIB,将RGB_Data() 复制到DIB中,然后BITBLT出来就可以了
      

  3.   

    http://blog.csdn.net/wallescai/archive/2004/12/31/235270.aspx 
    慢慢看,希望对你有用
      

  4.   

    这是我做的,部分代码
    你看看吧
    用API函数GetPixel,SetPixelV
    Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
    Private Declare Function SetPixelV Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal crcolour As Long) As Long
    Sub ruihua(ByVal ha&, ByVal hd&, ByVal w, ByVal h)
    Dim c1, c2, c3, c4, c5, c As Long
    Dim x0, y0 As Long
    Dim r, g, b As Long
    Screen.MousePointer = 11
    For x0 = 0 To w
    For y0 = 0 To h
    c1 = GetPixel(ha, x0, y0)
    c2 = GetPixel(ha, x0 + 1, y0)
    c3 = GetPixel(ha, x0, y0 + 1)
    c4 = c3 - c1
    c5 = c2 - c1
    If c4 > c5 Then
    c = c4
    Else
    c = c5
    End If
    r = (c And &HFF)
    g = (c And 62580) / 256
    b = (c And &HFF0000) / 256
    If r > 255 Then
    r = 255
    ElseIf r < 0 Then
    r = 0
    End If
    If g > 255 Then
    g = 255
    ElseIf g < 0 Then
    g = 0
    End If
    If b > 255 Then
    b = 255
    ElseIf b < 0 Then
    b = 0
    End If
    SetPixelV hd, x0, y0, RGB(r, g, b)
    'DoEvents
    Next y0
    Next x0
    Screen.MousePointer = 0
    End Sub
      

  5.   

    做一张同规格都完整176*144BMP图,然后提取文件头加到数组前,再把它们还原成一个bmp文件,再用picturebox 显示出来
      

  6.   

    其实176*144大小的图片,秒点也不算太慢,只要先把PICTURE设为不可见,描完之后再设为可见,速度还是可以接受的