是他们的方式来阻止被调整时,闪烁的图片框?他们的、方式、图片

2023-09-05 04:09:35 作者:冷眸

我有,我想在我的vb.net应用程序,包括图像,所以我切片它在Photoshop中,把它分成多个图片框,并挂靠到相应所以当我的应用程序大小,它不会伸展的所有部分图片。这是所有好的,它看起来不错,几乎适用great..except,当窗体被调整是导致pictureboxes闪烁的事实。

I have an image that I wanted to include in my vb.net app, so I sliced it up in photoshop and divided it into multiple picture boxes, and anchored them accordingly so when my application is resized it wont stretch all parts of the image. That is all good, it looks great and almost works great..except the fact that when the form is being resized it is causing the pictureboxes to flicker.

我知道该图片是不是最快的控制,所以我geussing它不刷新速度不够快。除了闪烁似乎与即使pictureboxes是透明的下方的白色背景。

I know that the picturebox is not the fastest control, so I am geussing it is not refreshing fast enough. Aside from flickering it appears with a white background underneath even though the pictureboxes are transparent.

我尝试添加一个背景色为背景,希望它会隐藏闪烁的更好而载入无济于事。

I tried adding a BG colour for the background hoping it would hide the flickering better while loading to no avail.

所以,我的拳头问题将是他们的任何方式$ P $的pventing呢?如果没有是他们的一个控制,速度更快,我可以用?

So my fist question would be is their any way of preventing this? If not is their a control that is faster that I could use?

也许一个自定义的图片框有人知道,或者即使你知道这就是控制速度更快。基本上任何控制,将允许一个背景图片和透明背景色将作为长期工作,因为它比较快。

Maybe a custom picture box someone knows, or even if you know a control thats faster. Basically any control that would allow a background image and transparent BG color would work as long as it is faster.

我真的AP preciate任何帮助。谢谢。 PS:我的应用程序是在VB.net,但我加入一个C#的标签藏汉因为我最有可能将不得不代替切换至code修复它的控制

I really appreciate any help. Thanks. PS: My application is in VB.net but I am adding a C# tag aswell because I am most likely going to have to switch controls instead of repairing it through code.

推荐答案

二,避免在形式上ü可以使用下面的函数在闪烁控制 只有复制并粘贴在任何地方在form.vb

Two avoid flickering in controls in form u can use following function Only copy it and paste it anywhere in form.vb

Protected Overrides ReadOnly Property CreateParams() As CreateParams
        Get
            Dim cp As CreateParams = MyBase.CreateParams
            cp.ExStyle = cp.ExStyle Or &H2000000
            Return cp
        End Get
    End Property 'CreateParams

只有粘贴anwhere是只读属性。

only paste anwhere it is readonly property