realbasic-nug
[Top] [All Lists]

How do I draw a dashed border for an Object2D?

To: "REALbasic NUG" <realbasic-nug at lists dot realsoftware dot com>
Subject: How do I draw a dashed border for an Object2D?
From: "Peter K. Stys" <pkstys at gmail dot com>
Date: Fri, 28 Apr 2006 11:23:06 -0400
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:mime-version:content-type:content-transfer-encoding:content-disposition; b=jDO7gjY1cNXTh/qRJlkaDjiZtRYi4UZuIiQ69liAjIlBhLzo6D08lsWIo+zbqcY2fH1WVqOEnCAxgEb65Mu0eJRXHifYXdeOZJyUfvoJKnQ22avqOrnypYdcI/lxeDn0keBScRPR12nhI3BOyIoiDCpc2+Y8xee8SoSTGXIgKO4=
Further to my recent post re QuickDraw issues, I decided to move my
code into the 21st century and do all my shapes using RB Object2Ds
(RectShapes, etc...)

In QD, it was easy to draw the classic marching ants selection outline
by shifting a pattern and redrawing in response to a timer.

Never mind the marching, all I want now is the ants, ie. a dashed
border for my RectShapes and CurveShapes.

Anyone have info on how to do this?

Thx,
Peter.

--
-------------------------------------------------------------------------------
Peter K. Stys, MD
Professor of Medicine(Neurology), Senior Scientist
Ottawa Health Research Institute, Div. of Neuroscience
Ottawa Hospital / University of Ottawa
Ontario, CANADA
tel:    (613)761-5444
fax:    (613)761-5330
http://www.ohri.ca/profiles/stys.asp
-------------------------------------------------------------------------------
_______________________________________________
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 28 Apr 2006 09:41:03 -0600
Return-Path: <realbasic-nug-bounces at lists dot realsoftware dot com>
Received: from lists.realsoftware.com (209.198.132.125) by realsoftware.com
with ESMTP (Eudora Internet Mail Server 3.1.3);
Fri, 28 Apr 2006 10:41:21 -0500
Received: from lists.realsoftware.com (localhost [127.0.0.1])
        by lists.realsoftware.com (Postfix) with ESMTP
        id 31FE41228F86; Fri, 28 Apr 2006 10:41:10 -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 firey.dreamhost.com (firey.dreamhost.com [66.33.193.188])
        by lists.realsoftware.com (Postfix) with ESMTP id 19F131228F77
        for <realbasic-nug at lists dot realsoftware dot com>;
        Fri, 28 Apr 2006 10:41:03 -0500 (CDT)
Received: from [10.0.1.2] (c-67-174-105-26.hsd1.co.comcast.net [67.174.105.26])
        by firey.dreamhost.com (Postfix) with ESMTP id F211716D7F9
        for <realbasic-nug at lists dot realsoftware dot com>;
        Fri, 28 Apr 2006 08:41:02 -0700 (PDT)
Date: Fri, 28 Apr 2006 09:41:03 -0600
From: joe at strout dot net
To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
In-Reply-To: <77124270604280823l8b80507vc8f8fc47b182d5f5 at mail dot gmail dot 
com>
X-Mailer: VerEx Email Gateway
Content-type: text/plain;
Content-transfer-encoding: 7bit
Message-Id: <20060428154102 dot F211716D7F9 at firey dot dreamhost dot com>
Subject: Re: How do I draw a dashed border for an Object2D?
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

You wrote:

Further to my recent post re QuickDraw issues, I decided to move my
code into the 21st century and do all my shapes using RB Object2Ds
(RectShapes, etc...)

In QD, it was easy to draw the classic marching ants selection outline
by shifting a pattern and redrawing in response to a timer.

Never mind the marching, all I want now is the ants, ie. a dashed
border for my RectShapes and CurveShapes.

Right -- unfortunately patterns (in the QD sense) aren't something easily 
supported cross-platform.  But what you can do is draw your borders into the 
mask of a picture, the image of which has been filled with an appropriate 
pattern.  Then draw this picture to the final graphics context.

Of course, you'll notice that you don't see the marching-ants selection style 
in Apple apps anymore -- the more fashionable look these days seems to be the 
translucent region, which is actually quite a bit easier to do (on OS X, at 
least) with the Object2D classes.

HTH,
- Joe

--
Joe Strout -- joe at strout dot net
Available for custom REALbasic programming or instruction.

_______________________________________________
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>