Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

mBlack

Serious problem with Delphi 6

This topic is 5791 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I don''t know if anyone noticed this, but delphi 6 has a little problem, that in my case is the biggest problem ever. No matter what animation tehnique you use, the TImage component allways flickers. I''ve tried setting the pen to pmXOR, i''ve tried clearing the whole canvas, I''ve tried drawing to an auxiliary surface(TBitmap in this case) and after all is drawn, put it on the canvas, but i allways get the same result. Get anyone please help me out ?!

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Have you tried checking the vertical retrace? I did the same thing and it worked. Go to the old DOS game programming archives and look for a short assembler procedure that holds until a vertical retrace (its only about 8 lines of code). Call it just before you blit to screen.

Share this post


Link to post
Share on other sites
There is a bug in Delphi 6 with TImage. Set the Stretch property to True if you plan on drawing on its canvas. You might also think about handling the WM_ERASEBKGND message and returning 1, so that the form background is not erased (which depends on your app''s requirements, of course...).

Alternatively, use a graphics library that most definitely does not suck: Graphics32. It''s damned good. Check out the compiled examples if you''re still not convinced (especially Gradlines_ex.exe). It has support for alpha blending, transformations (rotation, scaling, etc.), filtering for images, layers. It''s faster, flicker-free and ten squillion times more advanced than the VCL graphics components.

Share this post


Link to post
Share on other sites
Use double-buffering...

example:

var
Buffer: TBitmap;


// initialization (e.g. Form.Create)
Buffer := TBitmap.Create;
Buffer.Width := 640;
Buffer.Height := 480;

// draw stuff onto the bitmap's canvas here
BitBlt(Form1.Canvas.Handle, 0, 0, Buffer.Width, Buffer.Height, Buffer.Canvas.Handle, 0, 0, SRCCOPY);

this will eliminate the flicker...




[edited by - Harry Hunt on December 11, 2002 12:50:45 PM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!