Board index » delphi » Double Buffering Canvas

Double Buffering Canvas

I am currently working on a program that draws a cube on a form's
canvas.  Everytime i rotate the cube, it flickers. Could anyone tell me
how to double buffer the canvas so that it doesn't flicker?  The
procedure im using to draw the cube is in another unit, ie:

procedure DrawCube(ACube: TCube; CanvasHandle: HDC);
var TempCanvas: TCanvas;
begin
  TempCanvas := TCanvas.Create;
  TempCanvas.Handle := CanvasHandle;
  {Drawing routines here}
end;

The above code works except for the flicker.

Thanks in advance.

 

Re:Double Buffering Canvas


Muhammed-Sharif:

Your posting never appeared on the Borland server and
was not seen by most of the Borland community.

You're probably reading a copy of the Borland newsgroups
from your local ISP. This is fine for reading the
newsgroups, but not for sending messages. Most ISPs don't
post individual messages to the Borland servers. So if you
try to post a message, it will be arrive at your ISP's copy
of Borland's newsgroups, but it will never reach Borland's
servers themselves. *You'll* see it, but people reading
Borland's servers directly will *never* see it. Like this
message, which has not been seen on Borland's servers
either.

So if you've been getting few or no replies to your posts,
now you know why.

To connect to Borland's server directly yourself, follow
the instructions here:
http://www.borland.com/newsgroups/newsinfo.html

If you cannot connect directly to newsgroups because
of a firewall, you can post to Borland's newsgroups
via the web pages at http://newsgroups.borland.com/

Comments about this should be directed to the "real"
borland.public.delphi.non-technical

Quote
"Muhammed-Sharif Hussein" <muhammed_sha...@hotmail.com> wrote in message

news:3A066803.9966A511@hotmail.com...

Quote
> I am currently working on a program that draws a cube on a form's
> canvas.  Everytime i rotate the cube, it flickers. Could anyone tell me
> how to double buffer the canvas so that it doesn't flicker?  The
> procedure im using to draw the cube is in another unit, ie:

> procedure DrawCube(ACube: TCube; CanvasHandle: HDC);
> var TempCanvas: TCanvas;
> begin
>   TempCanvas := TCanvas.Create;
>   TempCanvas.Handle := CanvasHandle;
>   {Drawing routines here}
> end;

> The above code works except for the flicker.

Try the "Flicker Elimination" links on this page:
http://www.efg2.com/Lab/Library/Delphi/Graphics/Algorithms.htm

Here's an example that uses an in-memory bitmap the same size as a TImage
to do something similar:

http://www.efg2.com/Lab/Graphics/SphereInCubeMovie.htm

Hope your next post is seen on the "real" Borland newsgroups.

--
efg

Earl F. Glynn     E-mail:  e...@efg2.com
Overland Park, KS  USA

efg's Computer Lab:  http://www.efg2.com/Lab

Re:Double Buffering Canvas


Dear Earl,

I got a simmilair comment from a news reader, he said that i have to
configure my newsreader, i use Agent 1.8 but i think i have not
configured my reader proper, what do i have to change?

Thanks a lot! jeroen02

On Mon, 06 Nov 2000 17:12:47 GMT, "Earl F. Glynn" <EarlGl...@att.net>
wrote:

Quote
>Muhammed-Sharif:

>Your posting never appeared on the Borland server and
>was not seen by most of the Borland community.

>You're probably reading a copy of the Borland newsgroups
>from your local ISP. This is fine for reading the
>newsgroups, but not for sending messages. Most ISPs don't
>post individual messages to the Borland servers. So if you
>try to post a message, it will be arrive at your ISP's copy
>of Borland's newsgroups, but it will never reach Borland's
>servers themselves. *You'll* see it, but people reading
>Borland's servers directly will *never* see it. Like this
>message, which has not been seen on Borland's servers
>either.

>So if you've been getting few or no replies to your posts,
>now you know why.

>To connect to Borland's server directly yourself, follow
>the instructions here:
>http://www.borland.com/newsgroups/newsinfo.html

>If you cannot connect directly to newsgroups because
>of a firewall, you can post to Borland's newsgroups
>via the web pages at http://newsgroups.borland.com/

>Comments about this should be directed to the "real"
>borland.public.delphi.non-technical

>"Muhammed-Sharif Hussein" <muhammed_sha...@hotmail.com> wrote in message
>news:3A066803.9966A511@hotmail.com...
>> I am currently working on a program that draws a cube on a form's
>> canvas.  Everytime i rotate the cube, it flickers. Could anyone tell me
>> how to double buffer the canvas so that it doesn't flicker?  The
>> procedure im using to draw the cube is in another unit, ie:

>> procedure DrawCube(ACube: TCube; CanvasHandle: HDC);
>> var TempCanvas: TCanvas;
>> begin
>>   TempCanvas := TCanvas.Create;
>>   TempCanvas.Handle := CanvasHandle;
>>   {Drawing routines here}
>> end;

>> The above code works except for the flicker.

>Try the "Flicker Elimination" links on this page:
>http://www.efg2.com/Lab/Library/Delphi/Graphics/Algorithms.htm

>Here's an example that uses an in-memory bitmap the same size as a TImage
>to do something similar:

>http://www.efg2.com/Lab/Graphics/SphereInCubeMovie.htm

>Hope your next post is seen on the "real" Borland newsgroups.

Other Threads