Re: points vs pixels.

From: Dale King (KingD_at_tmicha.net)
Date: 05/25/04


Date: Tue, 25 May 2004 10:12:53 -0500


"Roedy Green" <look-on@mindprod.com.invalid> wrote in message
news:<m0rpa010mo4qfaedt6mdna0iuq1iif36mk@4ax.com>...
> On Thu, 20 May 2004 16:36:37 GMT, Roedy Green
> <look-on@mindprod.com.invalid> wrote or quoted :
>
> >>default device coordinate space is 72 units per inch which does
> >>not necessarily correspond to pixels. The user can then add an
> >>affine transform to create whatever coordinate system they like.
> >
> >I will add that.
>
> This is now done. The material was there before, it is just now I put
> more emphasis on it.

You added very little emphasis on it. You add it as an afterthought as
though it were extraneous information. I'm sorry to be so nit-picky and this
is an advanced topic that requires a paradigm shift in your way of thinking.
But I don't think it is best to teach newbies the flawed concept of thinking
in pixels only to then have to have them unlearn it later. It is best to
start them down the right path from the beginning.

Issues:

"The origin 0,0 is in the top left corner...not the bottom left where
Descartes put it": Technically Descartes put it in the center. The notion of
top and bottom corresponding to a particular direction for y is an arbitrary
convention.

"For Java units are integer pixels": That was true for Java 1.1 but not for
Java2D, where they are neither integer nor pixels.

"For mouse events, drawing geometric shapes, and placing Components with
absolute co-ordinates in the null layout, the origin 0,0 is the upper left
corner.": The issue is the upper left corner of what? The answer depends on
the situation, but is usually the container of the component.

"When you place an object on the screen, you specify the location of its
upper left corner.": Not necessarily true in user coordinate space.

"For GridBagLayouts the origin 0,0 is the upper left corner of the enclosing
container": This is not a function of the layout but of the container.

"drawRectangle and brothers deliberately draw rectangles one pixel taller
and wider than requested": That is true, but in Java2D you use drawShape and
have much greater control. You specify where the border of the shape is and
the stroke that is drawn on top of that line such that typically you are
specifying the center of the drawn outline.

"Because co-ordinates are measured in hardware-dependent pixels, images
generated by Java programs will be smaller when they are displayed on high
resolution displays": Not in Java2D

I could go on but, I think that is a representative sample.

-- 
Dale King
My Blog: http://nobleware.homedns.org/Blog


Relevant Pages

  • Re: redraw pictureboxes in image????
    ... on the size of the container but I need some help. ... container, but taking an example of a container that is 200 pixels wide, ... Labels can be almost 100 pixels wide ... underneath the icons. ...
    (microsoft.public.vb.general.discussion)
  • Re: redraw pictureboxes in image????
    ... on the size of the container but I need some help. ... its left and the right icon at 3/4 of its left. ... I don't know what sort of sizes you envisage for the container, but taking an example of a container that is 200 pixels wide, you've already said that you want one image to be 40 pixels wide and the other to be about 26 pixels or 28 pixels wide. ... Also, when you look at the maximum size of the Labels, which are of necessity centralised horizontally beneath beneath each image, in order for them to be properly centred and also to not overlap the central point of the "approximately middle" space, the Label beneath the large image cannot be wider than 72 pixels and the Label beneath the small image cannot be wider than 60 pixels, severely restricting their usefulness and further reinforcing the waste of valuable "real estate" at the left and right sides of the container. ...
    (microsoft.public.vb.general.discussion)
  • Re: Keep the ration while resizing a form
    ... Keep enough space for your varying captions, use the default font, keep the ... A container such as a Panel or Form or TabPage should calculate ... > size based on the conatained controls and subcontainers and the desired ... > the size of anything in pixels, because giving the size in pixels isn't a ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Image file resizer for OS X
    ... I want to be able to specify the maximum dimensions - ie, to specify, say, 500 x 400 pixels, so that the resulting image will be 500 pixels wide if it's landscape format and 400 pixels high if it's portrait format. ... - It needs to sharpen the image, and some control over the degree of sharpening would be good. ... but doesn't allow text watermarking. ...
    (comp.sys.mac.apps)
  • Re: 3 columns: reposition X for center column visible/invisible
    ... exceptions) what tags you use from the point of view of display, ... you're setting the width on everything in pixels, ... It's a bit annoying that you have to work out the width of the container ... Also good luck in fitting in the list markers if you want them. ...
    (comp.infosystems.www.authoring.stylesheets)