Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Antialiased rendering on a transparent image

You need to paint the background first. The operating system will blend 
the text with your background.

Felipe




Kirill Grouchnikov <kirillcool@xxxxxxxxx> 
Sent by: platform-swt-dev-bounces@xxxxxxxxxxx
16/11/2007 12:57 PM
Please respond to
"Eclipse Platform SWT component developers list." 
<platform-swt-dev@xxxxxxxxxxx>


To
"Eclipse Platform SWT component developers list." 
<platform-swt-dev@xxxxxxxxxxx>
cc

Subject
Re: [platform-swt-dev] Antialiased rendering on a transparent image






Hi Felipe,

Thanks for the reply. Is it possible to create a fully transparent image 
and then draw text / line in anti-aliased mode on that image? Or are you 
saying that the OS will make all the text pixels fully opaque? If this is 
true, then does it mean that i have to paint the relevant background 
myself before drawing the text? 

I was thinking about drawing the background separately and then draw the 
text as a translucent layer on top of that and have it "blended" together. 
This can be done in Swing's Java2D quite easily. But perhaps for AA 
rendering the "outlier" pixels derive their color from the underlying 
background, which would mean that you can't apply the same translucent 
text on any random background color.

Thanks
Kirill

----- Original Message ----
From: Felipe Heidrich <Felipe_Heidrich@xxxxxxxxxx>
To: Eclipse Platform SWT component developers list. 
<platform-swt-dev@xxxxxxxxxxx>
Sent: Friday, November 16, 2007 9:43:38 AM
Subject: Re: [platform-swt-dev] Antialiased rendering on a transparent 
image

Hi Kirill

Currently, the operating system will not set alpha in the image where the 
text is drawn. The resulting pixel is text foreground composed with 
background and alpha value of the antialiasing for that pixel.

Felipe





Kirill Grouchnikov <kirillcool@xxxxxxxxx> 
Sent by: platform-swt-dev-bounces@xxxxxxxxxxx
15/11/2007 08:22 PM
Please respond to
"Eclipse Platform SWT component developers list." 
<platform-swt-dev@xxxxxxxxxxx>


To
platform-swt-dev@xxxxxxxxxxx
cc

Subject
[platform-swt-dev] Antialiased rendering on a transparent image






After searching Google for relevant examples and posting on SWT forum and 
getting no replies, i'm finally turning to the "source". 

Is it possible to create a fully transparent SWT image and then render 
antialiased text or other primitives (such as lines) on it? If i just mark 

one color as transparent, it will not mark the anti-aliased pixels around 
the text as having partial translucency - or perhaps this is an expected 
result with subpixel rendering? Or perhaps the subpixel rendering expects 
the background color / texture to be present in order to create the 
correct blended text pixels?

What i'm looking for is to create an SWT image, render some text and then 
iterate over the pixels of the SWT image, expecting alpha value to be 0 
where there is no text, 255 where there is a full pixel and between 0 and 
255 in the pixels around the text.

Hope this makes sense.

Thanks
Kirill


Never miss a thing. Make Yahoo your homepage. 
_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev


_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev


Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See 
how._______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev




Back to the top