AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Subpixelprecision (without antialias)

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> comp.lang.java
View previous topic :: View next topic  
Author Message
Rune Zedeler
Guest





PostPosted: Sat Feb 10, 2007 6:08 am    Post subject: Subpixelprecision (without antialias) Reply with quote



Not sure whether this is the right group. Help on that appreciated as well.

I need to draw lines in subpixelprecision. Downscaling the canvas from
Graphics2D should imho do that.

The program

import java.awt.*;
import javax.swing.*;
public class TestGfx2D extends JPanel {
public TestGfx2D() {
JFrame f = new JFrame();
setPreferredSize(new Dimension(16,16));
f.add(this);
f.pack();
f.setVisible(true);
}
public void paint(Graphics g) {
Graphics2D g2 = (Graphics2D)g;
g2.scale(.25,.25);
for(int i=0; i<6; i++) {
g2.drawLine(0,9*i,40,10+9*i);
}
}
public static void main(String[] args) {
new TestGfx2D();
}
}

thus should yield:

|XXXX
| XXXX
|XXX XXX
| XXXX
|XX XXXX
| XXXX
|X XXXX
| XXXX X
| XXXX
|XXXX XX
| XXXX
|XXX XXX
| XXXX
| XXXX

- men it /yields/ on my system (sun java 5, ubuntu):

|XXX
| XXXXX
|XXX XXX
| XXXXX
|XX XXX
| XXX
|XX XXXX
| XXX XX
| XXXX
|XXX XX
| XXXXX
|XXX XXX
| XXXXX
| XXX

I tried setting renderinghints, but I cannot get subpixelprecision
without getting antialias at the same time :-(

Are others experiencing the same, and does anybody know a workaround?
(Really not into having to implement my own subpixel-stuff)

-Rune
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> comp.lang.java All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.