realbasic-nug
[Top] [All Lists]

Re: How do I draw a dashed border for an Object2D?

To: "REALbasic NUG" <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: How do I draw a dashed border for an Object2D?
From: "Peter K. Stys" <pkstys at gmail dot com>
Date: Fri, 28 Apr 2006 12:59:37 -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:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=HWM0R1UMpOyfQTIV+HgpnXc4RuCsXjgVCBbFwV1T86c6rhnINE/x4761bTXwB7MJKWtvqTZoYNJDaf46V7VdhUXvZaDmu7L4j2TcFeJFEY2p3naD/zbvVhhtztxvdpIJDKvW2v6XSHaH1EDfGj+7hP/+vLAhyEXXVF9g86us6Gg=
References: <77124270604280823l8b80507vc8f8fc47b182d5f5 at mail dot gmail dot com> <20060428154102 dot F211716D7F9 at firey dot dreamhost dot com>
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.


But if I fill the mask with a zebra pattern, draw the the borders into
this mask, then if I draw this picture into the final graphics
context, that will change my entire underlying image (atop which I
want to draw just a dashed outline) into a zebra, no?


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.

I do realize that marching ants is passé.  Is there another way, eg.
passing an RB Object2D to one of the CoreGraphics routines via a
declare to make its (or a derivative of this Object2D) border dashed? Speaks to the larger issue of how to massage RB's already rich vector
graphics suite with CoreGraphics, Quartz, OpenGL or whatever?

Thanks!
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 11:23:37 -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 12:23:54 -0500
Received: from lists.realsoftware.com (localhost [127.0.0.1])
        by lists.realsoftware.com (Postfix) with ESMTP
        id 0341312298CD; Fri, 28 Apr 2006 12:23:46 -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 jareth.dreamhost.com (jareth.dreamhost.com [66.33.198.201])
        by lists.realsoftware.com (Postfix) with ESMTP id 2C28012298BE
        for <realbasic-nug at lists dot realsoftware dot com>;
        Fri, 28 Apr 2006 12:23:38 -0500 (CDT)
Received: from [10.0.1.2] (c-67-174-105-26.hsd1.co.comcast.net [67.174.105.26])
        by jareth.dreamhost.com (Postfix) with ESMTP id CC382190F39
        for <realbasic-nug at lists dot realsoftware dot com>;
        Fri, 28 Apr 2006 10:23:36 -0700 (PDT)
Date: Fri, 28 Apr 2006 11:23:37 -0600
From: joe at strout dot net
To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
In-Reply-To: <77124270604280959s7f65bf9fq1129ca03c73c2c15 at mail dot gmail dot 
com>
X-Mailer: VerEx Email Gateway
Content-type: text/plain;
Content-transfer-encoding: 7bit
Message-Id: <20060428172336 dot CC382190F39 at jareth 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

Peter wrote:

But if I fill the mask with a zebra pattern, draw the the borders into
this mask, then if I draw this picture into the final graphics
context, that will change my entire underlying image (atop which I
want to draw just a dashed outline) into a zebra, no?

Yes.  What, you want XOR mode too?  :)  That's another thing that doesn't work 
well cross-platform (and isn't supported by Quartz at all, nor did it ever work 
well on, say, a gray image.)

I do realize that marching ants is passé.  Is there another way, eg.
passing an RB Object2D to one of the CoreGraphics routines via a
declare to make its (or a derivative of this Object2D) border dashed?

No, not that I can think of.  An Object2D isn't a CoreGraphics object, though 
it may be rendered as one -- rather, it's a REAL Software invention, which is 
internally exactly the same on all platforms.  It doesn't get converted into 
something platform-specific until rendering, but you have no way to hook into 
or extend it at that point.

Best,
- 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>