PC Review


Reply
Thread Tools Rate Thread

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

 
 
raylopez99
Guest
Posts: n/a
 
      31st Oct 2008
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/micro...4f363036fc64f2

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
 
Reply With Quote
 
 
 
 
Jeff Johnson
Guest
Posts: n/a
 
      31st Oct 2008
"raylopez99" <(E-Mail Removed)> wrote in message
news:1edba0f7-d1f1-464b-9484-(E-Mail Removed)...

> 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.


 
Reply With Quote
 
raylopez99
Guest
Posts: n/a
 
      31st Oct 2008
On Oct 31, 7:53*am, "Jeff Johnson" <i....@enough.spam> wrote:

> 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
 
Reply With Quote
 
Jeff Johnson
Guest
Posts: n/a
 
      31st Oct 2008
"raylopez99" <(E-Mail Removed)> wrote in message
news:c7298220-fa85-42f0-9bc4-(E-Mail Removed)...
On Oct 31, 7:53 am, "Jeff Johnson" <i....@enough.spam> wrote:


> 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.


 
Reply With Quote
 
raylopez99
Guest
Posts: n/a
 
      31st Oct 2008
On Oct 31, 9:18*am, "Jeff Johnson" <i....@enough.spam> wrote:

> 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
 
Reply With Quote
 
Ben Voigt [C++ MVP]
Guest
Posts: n/a
 
      31st Oct 2008


"raylopez99" <(E-Mail Removed)> wrote in message
news:1edba0f7-d1f1-464b-9484-(E-Mail Removed)...
> 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/micro...4f363036fc64f2
>
> 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.

 
Reply With Quote
 
raylopez99
Guest
Posts: n/a
 
      31st Oct 2008
On Oct 31, 1:22*pm, "Ben Voigt [C++ MVP]" <r...@nospam.nospam> wrote:

> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Drawing A Pixel Abby Brown Microsoft C# .NET 6 28th Jul 2009 05:35 PM
Drawing a simple pixel to the foreground Carsten Schmitt Microsoft C# .NET 4 24th Oct 2006 07:22 PM
Drawing a single pixel Rob T Microsoft Dot NET Framework 9 24th Feb 2005 02:22 PM
Drawing a single pixel Rob T Microsoft VB .NET 9 24th Feb 2005 02:22 PM
How to fool IT people at my work...please, IT people, help Vanya Microsoft Windows 2000 13 18th Feb 2004 06:56 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:19 AM.