Jump to content

Image Double Buffering!

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
Bioshox

Bioshox

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 207 posts
Hey!

I'm abit off a n00b with Visual Basic!

So I have create a Maze Game for a project in college, I have a player and a trap, both the trap and player move, but they both flash!

I read it's possible to double duffer them so they don't flash.

Does anyone have the code/method of doing this?

Thank's!

Bioshox!

#2
CommittedC0der

CommittedC0der

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,565 posts
This is C# code but it may help you
// use double buffer to minimize flickering.
SetStyle(ControlStyles.ResizeRedraw, true);
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.DoubleBuffer, true);
I hope this helps heres the link to the site I got this from Detecting arrow key input (keypresses) - C# - Forums at ProgrammersHeaven.com.:)
A man can be defined by what he does when no one is looking.
Science is only an educated theory, which we cannot disprove.

#3
Bioshox

Bioshox

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 207 posts
This doesn't really help as I cant program in C# :(

#4
CommittedC0der

CommittedC0der

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,565 posts
Ya I know but C# it kinda close to VB anyway hope your using .NET because here's two links for double buffering in VB.NET.:)
VB Helper: HowTo: Draw a rubberband rectangle with and without double buffering in VB .NET Double buffering Windows Forms
A man can be defined by what he does when no one is looking.
Science is only an educated theory, which we cannot disprove.