When I has pictureboxes that move relatively fast at different speeds through the form on a relatively good computer it runs alright, but when I go onto a slightly worse computer, it lags if there are more then three pictureboxes moving at fast speeds on the form.Im not sure if this has anything to do with doublebuffering, could someone explain to mewhat doublebuffering is? And how I could fix my problem? The picturebox isn't a picture, just has its backcolor set to blue/red/green.
Double Buffering is explained very well here at Wikipedia.
Animated PictureBoxes can hardly be optimized, as they where never intended to be used for that.
Can you elaborate on what kind of animation you are trying to accomplish? Maybe a different approach, blitting into one PictureBox or even DirectX are more suitable for your task.
Just expanding on the above answer: if you think double-buffering is for you, do this:
In Form_Load, add the line DoubleBuffered=True.
Related
Is it possible to fix this drawing issue that looks like screen tearing on picturebox images when scrolling flowlayoutpanel?
https://imgur.com/zPDWO85
It's much more noticeable when scrolling with a mouse compared to scroll wheel (probably due to much more draw calls).
Ideas that I found on google and tried were mostly centered around double buffering, but they didn't work.
I don't mind them pooping in that much, but that smudging is horrible and unacceptable. Best solution would be of course to make it nice and smooth without flickering, popping and whatever else it may be doing.
after experimenting with VB.NET image and drawing classes, I am searching a new one that I could use.
The problem is that the actual classes are really slow and even a rate of 24 fps is too slow to refresh a moving 225x70 image and with double buffer. Using .FillRectangle with a brush is fast and could do the job, but the image is tiled behind the rectangle and does not move with the rectangle.
Do you have ideas of what I could do ? Please try to be clear in your answer if I need to install DLLs or things like that, as I am new to VB.net language.
*I already tried openTK, but it seems to be mostly 3D, I only need 2D. Should I use it anyway ? I can't find beginner tutorials for VB.NET.
I think XNA or GorgonLib would be the best options. OpenTK is good too, but I think it will be a little too complicated for just 2d drawing. There is also SDL.NET, but it hasn't been updated in a while and again, it's meant for 2d. The best 2d library I've used in terms of speed is allegro, but I'm not sure if there are any wrappers available for .NET.
Gorgon: http://code.google.com/p/gorgonlib/
This may be fairly obvious as I cant find it on Google but I have a windows form of a given height and width in the VS Designer and it looks perfect.
The object inspector and the ViewDesigner.VB all match up.
But when it gets compiled the window is noticeably bigger and brings with it a whole heap of wasted space around the edges. This is more than just ClientSize etc. This is a good inch or two.
Any idea whats causing it? It's not a resolution issue as this happens on the same machine.
For future reference this was nothing I was doing, it was coded into the larger application to retain window states.
So it simply re-sized to either what it was or what it thought it should be.
Thanks for the help and suggestions either way.
I'm making... well, it's sort of like a game in VB.net (using VS2008, if it matters). Being sort of like a game, it's dependent on timing, but it also has a large area (have to scroll the window on pretty much any resolution).
The problem I'm having is that whenever I scroll the window (or move any of the smaller, additional windows) the program pauses what it's doing, and doesn't start again until I stop scrolling (or moving windows, or whatever).
I hate to sound picky, but the program keeping track of how much time it's lost and making it up for it when you're finished scrolling isn't going to cut it.
So is there any way to stop it pausing when you scroll or move windows? Thanks for your answers.
Essentially, you can’t (reliably). Don’t use scroll controls, or in fact any controls at all. It’s a common beginners’ error to use multiple controls in a game.
Render all your game in one PictureBox control and scroll that using e.g. the ScrollDC Windows API function, or by building up the graphic incrementally as the user scrolls. This is more difficult but also usually more efficient since you only need to draw a smaller area (i.e. the visible area, and nothing more).
If that’s not fast enough, chances are that GDI+ graphics won’t cut it and you need to resort to DirectX/XNA.
Usually I am a web developer so this is probably a very novice question. I recently made an app in VB2008, but I developed it in a huge reso (1920x1200). The person that will be using it still uses 800x600 reso. Is there any simple way I can resize the entire interface to fit any resolution? I didn't really think about it at all while I was making the program.
I'm not sure if there's any simple way of changing your application. If you were writing an application from scratch I'd suggest looking at the Dock, Anchor, MinSize and MaxSize properties of the controls, all of which are quite useful to make them resize according to the total size of the application. Could be a bit annoying if you have to go in and change them all manually now though.
There's also the TableLayoutPanel control, you can read about it here.