 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Rune Zedeler Guest
|
Posted: Sat Feb 10, 2007 6:08 am Post subject: Subpixelprecision (without antialias) |
|
|
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 |
|
 |
|
|
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
|
|