1 message in net.java.dev.jna.usersRe: JNA
FromSent OnAttachments
Timothy WallJul 13, 2007 7:18 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: JNAActions...
From:Timothy Wall (twal@dev.java.net)
Date:Jul 13, 2007 7:18:34 am
List:net.java.dev.jna.users

Martin Vlach wrote:

Can you tell me, how to use rendering keys? If I switch on text_antialiasing and make area to put the text in WindowUtils.setWindowMask method - the shape is not aliased - so the numbers or letters are elegant. my code is: shape instance: Font font = new Font("Dialog",Font.BOLD,20); java.awt.font.FontRenderContext frc = new java.awt.font.FontRenderContext(font.getTransform(), true, true); ----> text is antialiased and using fractionalmetrics on java.awt.font.TextLayout tl = new java.awt.font.TextLayout ("pokus01", font, frc); Shape letterShape = tl.getOutline(); drawing shape in paint method: g.setColor(Color.RED); g.fill(letterShape); -----> draws beautiful string if and only if I don't use your WindowUtils.setWindowMask(m_frame, letterShape); If I use your method to make the letters background unvisible, it draws horrible string Can you help me please? I can use your interface, because it is easy to use and work with it gets excelent outcomes (within the strings -:))) ) best regards Martin

WindowUtils.setWindowMask applies a bitmap and ignores transparency. If you want to render pixels with different alpha values, then you need to use WindowUtils.setWindowTransparent. All painted pixels will be properly composited within the window, with alpha levels preserved.