Wow, Ken! It works like magic (the second method I mean). Thank you
very much. I think I would never guess it myself.
For those who will reuse this code, don't forget to save/restore the
graphics context because CGContextClipToMask modified the clipping
region.
Sorry for late thanking, I had to p
On Sun, Feb 1, 2009 at 4:35 AM, Benjamin Dobson
wrote:
> Am I missing something or could you use an NSGradient object to do this?
Sure, if you used a gradient or solid color to draw the background in
the first place. Just give the starting color an alpha of 0 and the
ending color an alpha of 1.
On 29 Jan 2009, at 06:32:45, Kyle Sluder wrote:
Perhaps the better solution is to draw the text as normal and then
re-draw the background with the appropriate alpha on top.
Am I missing something or could you use an NSGradient object to do this?
___
All else aside, yes you can do this in Cocoa and/or Quartz.
Here are a couple different ways. For instruction's sake, here's it done
with a compositing operation, NSCompositeDestinationIn. Result color =
what's already in the context but with additional alpha taken from the new
drawing.
- (void)
On Jan 29, 2009, at 5:08 PM, Peter N Lewis wrote:
One option is to draw the end of the string character by character
with varying alphas.
Glyph by glyph, really, in the general case. You can take a look at
the CircleView example for one case of drawing strings glyph by glyph--
with diffe
At 17:38 +0200 28/1/09, Oleg Krupnov wrote:
I want to produce the effect of a text string fading out when it's too
long to be displayed in a rect. This kind of effect is used in many
apps.
One option is to draw the end of the string character by character
with varying alphas.
Ie, instead of
On 29 Jan 2009, at 09:33, Rob Keniger wrote:
On 29/01/2009, at 6:27 PM, Oleg Krupnov wrote:
Yeah, the question is however how do I technically (e.g. in Cocoa)
composite the "appropriate alpha" with an image, whether the
background image, as you suggest, or with text image, as Ricky
suggested
On 29/01/2009, at 6:27 PM, Oleg Krupnov wrote:
Yeah, the question is however how do I technically (e.g. in Cocoa)
composite the "appropriate alpha" with an image, whether the
background image, as you suggest, or with text image, as Ricky
suggested.
AFAIU, there is not such NSCompositingOperati
Yeah, the question is however how do I technically (e.g. in Cocoa)
composite the "appropriate alpha" with an image, whether the
background image, as you suggest, or with text image, as Ricky
suggested.
AFAIU, there is not such NSCompositingOperation to do this trick. It
appears that I need to iter
On Jan 28, 2009, at 22:32, Kyle Sluder wrote:
On Wed, Jan 28, 2009 at 10:57 AM, Thomas Davie
wrote:
This solution will also throw sub-pixel anti-aliasing in the bin.
Perhaps the better solution is to draw the text as normal and then
re-draw the background with the appropriate alpha on top.
On Wed, Jan 28, 2009 at 10:57 AM, Thomas Davie wrote:
> This solution will also throw sub-pixel anti-aliasing in the bin.
Perhaps the better solution is to draw the text as normal and then
re-draw the background with the appropriate alpha on top.
--Kyle Sluder
___
Sounds interesting, but how do I technically "composite the image with
the mask"?
Also I'm not sure I understand the resolution issues you mentioned.
Could you please give a little bit more detail? Thanks!
On Wed, Jan 28, 2009 at 5:49 PM, Ricky Sharp wrote:
> You could render your text to an i
On 28 Jan 2009, at 16:49, Ricky Sharp wrote:
You could render your text to an image first, composite it with the
opaque-to-transparent mask and finally draw the result.
I used to create images from text, but I ended up with issues
regarding resolution independence for some reason. So, you
You could render your text to an image first, composite it with the
opaque-to-transparent mask and finally draw the result.
I used to create images from text, but I ended up with issues
regarding resolution independence for some reason. So, you may need to
test this solution with RI if need
I want to produce the effect of a text string fading out when it's too
long to be displayed in a rect. This kind of effect is used in many
apps.
My first solution was to simply draw the text and then on top of it
draw a gradient fill ranging from the fully transparent color to the
background color
15 matches
Mail list logo