改变有图片背景的Form大小时,Form发生闪烁,请教如何消除闪烁现象?
步骤:
1.创建新工程
2.添加Image控件,属性 Stretch=True
                      picture = app.path & "\sy4.bmp"
3.编写代码。为使图片随窗口的大小改变而改变,编写如下代码:
   Private Sub Form_Load()
      Image1.Width = Me.Width / Screen.TwipsPerPixelY
      Image1.Height = Me.Height / Screen.TwipsPerPixelX
   End Sub   Private Sub Form_Resize()
      Image1.Width = Me.Width / Screen.TwipsPerPixelY
      Image1.Height = Me.Height / Screen.TwipsPerPixelX
   End Sub
4. 运行。
    当改变窗口的大小时,窗口发生闪烁现象

解决方案 »

  1.   

    用DIRECTX语句~~绝对不会闪烁~~~
      

  2.   

    试一下下面这种方法
    Private Sub Form_Load()
        Me.ScaleMode = 3
        Me.AutoRedraw = True
        Picture1.ScaleMode = 3
        Picture1.Picture = LoadPicture("c:/test.bmp")
    End SubPrivate Sub Form_Resize()
        
        Me.PaintPicture Picture1.Picture, 0, 0, Me.ScaleWidth, Me.ScaleHeight, 0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight
    End Sub
      

  3.   

    1.改用picture试试
    2.用lockwindowupdate form1.hwnd试试
      

  4.   

    DirectX语句几句话是说不清楚的~~
      

  5.   

    该问题已经解决,非常感谢大家的帮助!相关信息请到 VB_基础类 中查看!
    1.朋友 yimain(残雪) 提供的代码已测试,未成功(图像显示大于窗口)。
    2.关于DirectX,不知jackcaixia(风) 朋友能否提供些资料?
      

  6.   

    资料是有~~我以前写过~~不过很难~~
    DirectX语句其实是写游戏的~~