Drawing smaller than 1 pixel (how do people fool the eye?) & infinitegrids

R

raylopez99

After refering to the below thread, I take it for C# Forms 2.0, there
a way to draw a 1 pixel by 1 pixel rectangle, which I was able to do
just now successfully.

http://groups.google.com/group/micr...l=en&lnk=gst&q=paint+a+pixel#444f363036fc64f2

But now the question is:

has anybody ever done a 'scaling problem' for a grid where you are
'zooming out'? I can construct this no problem, but at some point you
are going to maybe go below 1 pixel for a rectangle.

Then, I notice gamer designers do an "outline" to give a sort of
virtual shape (that's not really accurate, just a visual outline to
fool the eye into thinking it's accurate, then, when you zoom in, you
get the 'real' graphical object).

Anybody ever do this? You have to have an algorithm to figure out the
'outline' of the body you are zooming out on. I'm just curious what
people do when the resolution for "Zoom out" is such that your
rectangle is smaller than 1 pixel.

Bonus question: when doing an infinite grid, what numbers do you
choose for infinity? Do you simply choose a very large number, or,
the system.max number for ints, or, some other way?

Thank you,

RL
 
J

Jeff Johnson

has anybody ever done a 'scaling problem' for a grid where you are
'zooming out'? I can construct this no problem, but at some point you
are going to maybe go below 1 pixel for a rectangle.

Then, I notice gamer designers do an "outline" to give a sort of
virtual shape (that's not really accurate, just a visual outline to
fool the eye into thinking it's accurate, then, when you zoom in, you
get the 'real' graphical object).

Anybody ever do this? You have to have an algorithm to figure out the
'outline' of the body you are zooming out on. I'm just curious what
people do when the resolution for "Zoom out" is such that your
rectangle is smaller than 1 pixel.

There are numerous graphics algorithms for scaling built directly into the
..NET Framework, and you can use them if you want. However, I believe what
many game designers do is create multiple versions of an image or model for
different (I believe the term is) "resolutions." They have more control over
these hand-scaled images than if they let the graphics library do all the
work, and I think it's more art than science.
 
R

raylopez99

There are numerous graphics algorithms for scaling built directly into the
.NET Framework, and you can use them if you want. However, I believe what
many game designers do is create multiple versions of an image or model for
different (I believe the term is) "resolutions." They have more control over
these hand-scaled images than if they let the graphics library do all the
work, and I think it's more art than science.

Thanks Jeff, that was helpful.

I will rely on .NET framework for scaling, since I'm not really doing
a game so i don't need the precision of a game designer.

RL
 
J

Jeff Johnson

I will rely on .NET framework for scaling, since I'm not really doing
a game so i don't need the precision of a game designer.

You might want to ask future questions of this nature in
microsoft.public.dotnet.framework.drawing. Good folks in there, especially
Bob Powell.
 
R

raylopez99

You might want to ask future questions of this nature in
microsoft.public.dotnet.framework.drawing. Good folks in there, especially
Bob Powell.

hey Thanks again! you're better than Google (I could not find such a
group even after googling it). I've stumbled across Bob Powell's
website on my own, and it's good.

RL
 
B

Ben Voigt [C++ MVP]

raylopez99 said:
After refering to the below thread, I take it for C# Forms 2.0, there
a way to draw a 1 pixel by 1 pixel rectangle, which I was able to do
just now successfully.

http://groups.google.com/group/micr...l=en&lnk=gst&q=paint+a+pixel#444f363036fc64f2

But now the question is:

has anybody ever done a 'scaling problem' for a grid where you are
'zooming out'? I can construct this no problem, but at some point you
are going to maybe go below 1 pixel for a rectangle.

You have to blend with the background.

For example, if you have a white background and a 1 pixel by 1 pixel black
rectangle where the edges exactly lie on pixel boundaries, then one pixel of
the background is totally covered by black, you have one black pixel. If
the rectangle is offset so the center is on a pixel boundary, then half lies
in the left pixel, half in the right, half above, half below. There are
four pixels each 1/4 covered by the rectangle and the background shows
through the rest, so there are four pixels of 75% gray (0xC0C0C0). The
result is always an affine combination of the object color and the backdrop
color, weighted by the fraction of the pixel covered by the object. This
weight is often the "alpha channel", although alpha channel can also be used
for translucency.
 
R

raylopez99

You have to blend with the background.

For example, if you have a white background and a 1 pixel by 1 pixel black
rectangle where the edges exactly lie on pixel boundaries, then one pixelof
the background is totally covered by black, you have one black pixel.  If
the rectangle is offset so the center is on a pixel boundary, then half lies
in the left pixel, half in the right, half above, half below.  There are
four pixels each 1/4 covered by the rectangle and the background shows
through the rest, so there are four pixels of 75% gray (0xC0C0C0).  The
result is always an affine combination of the object color and the backdrop
color, weighted by the fraction of the pixel covered by the object.  This
weight is often the "alpha channel", although alpha channel can also be used
for translucency.

This makes sense. By successive blending, you can make the image
slowly look smaller and smaller while preserving (somewhat) the colors
and overall shape.

If you have an easy routine for this, please feel free to post it if
convenient so I can throw it into my library, in the event I ever
decide to do this trick.

RL
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top