realbasic-nug
[Top] [All Lists]

Re: canvas flicker on windows builds

To: "REALbasic NUG" <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: canvas flicker on windows builds
From: "Maarten de Vries" <maarten dot de dot zoveelste at gmail dot com>
Date: Fri, 30 Jun 2006 18:22:09 +0200
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=C6OwOCskXWI/Uamlog6V01P7iDL13Klgn4OrZeWadVBtjVvsWp3JYbq63XePCKc7Haaktf15NgO8UDdJj0HnFuTwf6ktpNxS7MIBb4F8UvBpGwOdlcCEbxNw5f8M15v/qcGe5fBDnvktuEFkrYQykY9Jg4cP2nr4U785Mb9rrNw=
References: <20060630155034 dot E2EA57F01A at swarthymail-a3 dot dreamhost dot com> <546A3FB7-B869-476B-8631-56B51D884DA4 at mac dot com>
You should call refresh, like I said. But you shouldn't call "canvas.refresh",
but "Canvas.Refresh FALSE". Try it.. you'll see it works

Maarten


On 30/06/06, John Kubie <jkubie at mac dot com> wrote:

How do I get the paint event to fire without canvas1.refresh? When I
remove the refresh statements the canvas doesn't update. (

I did it in my application, where a mousedown on the canvas creates a
new picture. This is drawn onto the canvas graphics in the paint
event. When I remove canvas1.refresh from the end of the mousedown
event, the canvas doesn't update.

If by "refresh" you mean just plain "refresh" or "self.refresh", I'm
not doing that, but I'm still getting flicker. I'll try implementing
your example (after I get out of work) to see if I see flicker.

John Kubie

On Jun 30, 2006, at 11:49 AM, joe at strout dot net wrote:

> There are many, and it's trivial to make such.  As others have
> pointed out, you simply need to avoid calling Refresh; draw
> directly into the canvas.graphics instead, without erasing.

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


From  Fri 30 Jun 2006 10:23:47 -0600
Return-Path: <realbasic-nug-bounces at lists dot realsoftware dot com>
X-Original-To: listarchive at realsoftware dot com
Delivered-To: listarchive at realsoftware dot com
Received: by xmail.realsoftware.com (Postfix, from userid 1037)
        id CD50B750B33; Fri, 30 Jun 2006 09:24:57 -0700 (PDT)
X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on www.realsoftware.com X-Spam-Level: X-Spam-Status: No, score=-1.5 required=4.5 tests=AWL,BAYES_00,NO_REAL_NAME autolearn=no version=3.1.1
Received: from lists.realsoftware.com (lists.realsoftware.com [209.198.132.125])
        by xmail.realsoftware.com (Postfix) with ESMTP id A7C2F750B2C;
        Fri, 30 Jun 2006 09:24:56 -0700 (PDT)
Received: from lists.realsoftware.com (localhost [127.0.0.1])
        by lists.realsoftware.com (Postfix) with ESMTP
        id 692CC1347344; Fri, 30 Jun 2006 11:24:44 -0500 (CDT)
X-Original-To: realbasic-nug at lists dot realsoftware dot com
Delivered-To: realbasic-nug at lists dot realsoftware dot com
Received: from swarthymail-a3.dreamhost.com (sd-green-bigip-98.dreamhost.com
        [208.97.132.98])
        by lists.realsoftware.com (Postfix) with ESMTP id 95B701347334
        for <realbasic-nug at lists dot realsoftware dot com>;
        Fri, 30 Jun 2006 11:24:38 -0500 (CDT)
Received: from [10.0.1.2] (c-67-174-105-26.hsd1.co.comcast.net [67.174.105.26])
        by swarthymail-a3.dreamhost.com (Postfix) with ESMTP id 1F7EE7F01A
        for <realbasic-nug at lists dot realsoftware dot com>;
        Fri, 30 Jun 2006 09:24:38 -0700 (PDT)
Date: Fri, 30 Jun 2006 10:23:47 -0600
From: joe at strout dot net
To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
In-Reply-To: <546A3FB7-B869-476B-8631-56B51D884DA4 at mac dot com>
X-Mailer: VerEx Email Gateway
Content-type: text/plain;
Content-transfer-encoding: 7bit
Message-Id: <20060630162438 dot 1F7EE7F01A at swarthymail-a3 dot dreamhost dot 
com>
Subject: Re: canvas flicker on windows builds
X-BeenThere: realbasic-nug at lists dot realsoftware dot com
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Sender: realbasic-nug-bounces at lists dot realsoftware dot com
Errors-To: realbasic-nug-bounces at lists dot realsoftware dot com

On Jun 30, 2006, at 16:04 UTC, John Kubie wrote:

How do I get the paint event to fire without canvas1.refresh?

You don't.  Why do you think you need the paint event to fire?

When I remove the refresh statements the canvas doesn't update. (

Then you're failing to draw to the Canvas.Graphics property when you want it to 
update, as I showed in my example.

I did it in my application, where a mousedown on the canvas creates a new picture. This is drawn onto the canvas graphics in the paint event.

No, in the Paint event you should be drawing to "g", not to me.graphics.  But 
the paint event shouldn't be involved during animation (such as in a MouseDown or 
MouseDrag event).

When I remove canvas1.refresh from the end of the mousedown event, the canvas doesn't update.

Of course, because you're not drawing anything.  Write some drawing code, and 
call it from the MouseDown event.  (If you want to *also* call this drawing 
code from the Paint event, that's fine, but not relevant to the animation.)

If by "refresh" you mean just plain "refresh" or "self.refresh", I'm not doing that, but I'm still getting flicker.

No, I mean refrain from refreshing the canvas (or the window, of course, which 
refreshes the canvas along with everything else).

I'll try implementing your example (after I get out of work) to see if I see flicker.

Do, and see how it draws directly to the canvas when you want the canvas 
content updated, without refreshing anything.  So, there is no flicker.

Best,
- Joe

--
Joe Strout -- joe at strout dot net
Verified Express, LLC     "Making the Internet a Better Place"
http://www.verex.com/

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


From  Fri 30 Jun 2006 10:25:16 -0600
Return-Path: <realbasic-nug-bounces at lists dot realsoftware dot com>
X-Original-To: listarchive at realsoftware dot com
Delivered-To: listarchive at realsoftware dot com
Received: by xmail.realsoftware.com (Postfix, from userid 1037)
        id 09B91750BD0; Fri, 30 Jun 2006 09:26:26 -0700 (PDT)
X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on www.realsoftware.com X-Spam-Level: X-Spam-Status: No, score=-1.5 required=4.5 tests=AWL,BAYES_00,NO_REAL_NAME autolearn=no version=3.1.1
Received: from lists.realsoftware.com (lists.realsoftware.com [209.198.132.125])
        by xmail.realsoftware.com (Postfix) with ESMTP id 1315A750BC8;
        Fri, 30 Jun 2006 09:26:25 -0700 (PDT)
Received: from lists.realsoftware.com (localhost [127.0.0.1])
        by lists.realsoftware.com (Postfix) with ESMTP
        id 19E5013473B2; Fri, 30 Jun 2006 11:26:15 -0500 (CDT)
X-Original-To: realbasic-nug at lists dot realsoftware dot com
Delivered-To: realbasic-nug at lists dot realsoftware dot com
Received: from swarthymail-a2.dreamhost.com (mailbigip2.dreamhost.com
        [208.97.132.53])
        by lists.realsoftware.com (Postfix) with ESMTP id 2CED3134739B
        for <realbasic-nug at lists dot realsoftware dot com>;
        Fri, 30 Jun 2006 11:26:07 -0500 (CDT)
Received: from [10.0.1.2] (c-67-174-105-26.hsd1.co.comcast.net [67.174.105.26])
        by swarthymail-a2.dreamhost.com (Postfix) with ESMTP id CDC80EB652
        for <realbasic-nug at lists dot realsoftware dot com>;
        Fri, 30 Jun 2006 09:26:06 -0700 (PDT)
Date: Fri, 30 Jun 2006 10:25:16 -0600
From: joe at strout dot net
To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
In-Reply-To: <b619b1330606300922y6313c799yc367910abe02ebf7 at mail dot gmail dot 
com>
X-Mailer: VerEx Email Gateway
Content-type: text/plain;
Content-transfer-encoding: 7bit
Message-Id: <20060630162606 dot CDC80EB652 at swarthymail-a2 dot dreamhost dot 
com>
Subject: Re: canvas flicker on windows builds
X-BeenThere: realbasic-nug at lists dot realsoftware dot com
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Sender: realbasic-nug-bounces at lists dot realsoftware dot com
Errors-To: realbasic-nug-bounces at lists dot realsoftware dot com

On Jun 30, 2006, at 16:22 UTC, Maarten de Vries wrote:

You should call refresh, like I said. But you shouldn't call "canvas.refresh",
but "Canvas.Refresh FALSE". Try it.. you'll see it works

Maarten, I think you're just confusing him.  These new-fangled approaches of 
passing False to the Refresh method, or unchecking EraseBackground on the 
Canvas, may work in some cases, but they're not necessary.  The tried and true 
approach of simply drawing to the canvas graphics, without calling Refresh at 
all, is cleaner and works reliably on any version of RB, running on any OS.

Best,
- Joe


--
Joe Strout -- joe at strout dot net
Verified Express, LLC     "Making the Internet a Better Place"
http://www.verex.com/

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>