473,386 Members | 1,698 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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
Feb 10 '07 #1
0 2265

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: Pete | last post by:
I have form/select which executes a function using onchange. No problem. However, when I validate the page with a strict HTML 4.01 doctype at http://validator.w3.org, it demands either an action or...
14
by: D. Alvarado | last post by:
Hello, I am trying to open a window containing an image and I would like the image to be flush against the window -- i.e. have no padding or border. Can I make this happen with a single call to a...
9
by: WalterR | last post by:
This is my first time here, so there may be earlier relevant threads of which I am unaware. Though my experience with DB2 is not extensive, such as it is was under OS/390 or equ. My main...
33
by: ankursinha | last post by:
Hi, Is it possible to write a C program that prints "Hello World" on screen without having a single semi-colon in the entire program? The extra constraint here is that u r not allowed to use...
7
by: Ralf Gedrat | last post by:
Hello! I have some Vb.Net applications, which are terminated at indefinite times without message. If I call in the program regulated system.GC.Collect, then the program is terminated here...
8
by: pcnerd | last post by:
I'm a VB.NET "newbie". I want to use AntiAlias, but every thing that I try the compiler doesn't like. Sometimes it will suggest a change, but when I change it, it doesn't like that either! Weird!...
2
by: Peted | last post by:
Are there any options to enable an antialias function on standard winform controls ? things like the displayed text on buttons , radio buttons and other standard controls look a bit jagged and...
5
by: mmcd79 | last post by:
I built a VB.net application that makes use of a machine level DB connection string setting, and a user level starting location setting. The machine level setting and the default user based...
5
by: Jonathan Kay | last post by:
Hi, I'd like to my WCF webservice to work both on SSL and without. Unfortunately searching has led to dead ends, references to changes that only work on the old previous beta versions and I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.