以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  窗口加背景图片后,总是不流畅  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=65750)

--  作者:lhlh
--  发布时间:2015/3/21 23:42:00
--  窗口加背景图片后,总是不流畅

上了个简单的例子,在A、B表之间切换一下明显看出来跳闪。如果窗口控件多时,问题更明显,怎么解决?

 

例子用的是论坛里的代码:

 

e.Form.Controls("Panel1").basecontrol.backgroundimage = getimage(ProjectPath & "Images\\背景4.jpg")
e.form.controls("Panel1").basecontrol.BackgroundImageLayout = Windows.Forms.ImageLayout.Stretch

 

如果不用第二句,就稍微好一点。

 

 

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:管理项目1.rar


--  作者:lsy
--  发布时间:2015/3/22 7:47:00
--  
Dim pnl As WinForm.Panel = e.Form.Controls("Panel1")
pnl.BaseControl.Gettype().GetProperty("DoubleBuffered",Reflection.BindingFlags.Instance Or System.Reflection.BindingFlags.NonPublic).SetValue(pnl.BaseControl,True,Nothing)

--  作者:lhlh
--  发布时间:2015/3/22 7:54:00
--  
版主好早!
--  作者:lhlh
--  发布时间:2015/3/22 8:44:00
--  

搞不明白,能在上面例子中改吗?图片不大都会这样,如果改用大一些的图片,会更慢,更跳闪。

[此贴子已经被作者于2015/3/22 8:45:26编辑过]

--  作者:有点甜
--  发布时间:2015/3/22 9:17:00
--  
Dim pnl As WinForm.Panel = e.Form.Controls("Panel1")
pnl.basecontrol.backgroundimage = getimage(ProjectPath & "Images\\背景4.jpg")
pnl.basecontrol.BackgroundImageLayout = Windows.Forms.ImageLayout.Stretch
pnl.BaseControl.Gettype().GetProperty("DoubleBuffered",Reflection.BindingFlags.Instance Or System.Reflection.BindingFlags.NonPublic).SetValue(pnl.BaseControl,True,Nothing)

--  作者:lhlh
--  发布时间:2015/3/22 9:50:00
--  
谢谢甜老师,不过测试效果不明显,看来只能用更小的图片了,有点遗憾。