Re: How to show individual pixels? (Was: Show Me The Pixel)

Tech-Archive recommends: Fix windows errors by optimizing your registry




"Martijn Mulder" <i@m> wrote in message
news:46ee96c2$0$85112$dbd4f001@xxxxxxxxxxxxxxxxxx
When I zoom in on an image, GDI+ automatically smoothens the edges between
the pixels. I am looking for a way to see the individual pixels as squares
in the enlarged image, like in MSPaint. I searched in vain in the
enumerations System.Drawing.Drawing2D.SmoothingMode and
System.Drawing.Drawing2D.InterpolationMode to find the constant that does
just that. How?

I would think that NearestNeighbor would be the one that matches the old
StretchBlt functionality.


Some code to illustrate the problem:

using System.Drawing;
using System.Windows.Forms;
class MyForm:Form
{
override protected void OnPaint(PaintEventArgs a)
{
Bitmap bitmap=new Bitmap(2,2);
Graphics graphics=Graphics.FromImage(bitmap);
graphics.Clear(Color.Green);
graphics.DrawLine(Pens.Red,1,1,2,2);
graphics.Dispose();
a.Graphics.DrawImage
(
bitmap,
new Rectangle(0,0,200,200),
new Rectangle(0,0,2,2),
GraphicsUnit.Pixel
);
}
[System.STAThread]
static void Main()
{
Application.Run(new MyForm());
}
}


.



Relevant Pages

  • How to show individual pixels? (Was: Show Me The Pixel)
    ... When I zoom in on an image, GDI+ automatically smoothens the edges between the pixels. ... I am looking for a way to see the individual pixels as squares in the enlarged image, ... override protected void OnPaint ... Bitmap bitmap=new Bitmap; ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Show Me The Pixel
    ... I am looking for a way to see the individual pixels as squares in the enlarged image, like in MSPaint. ... override protected void OnPaint ... Bitmap bitmap=new Bitmap; ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: How to show individual pixels? (Was: Show Me The Pixel)
    ... I am looking for a way to see the individual pixels as squares in the enlarged image, ... I searched in vain in the enumerations System.Drawing.Drawing2D.SmoothingMode and System.Drawing.Drawing2D.InterpolationMode to find the constant that does just that. ... override protected void OnPaint ... Bitmap bitmap=new Bitmap; ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Get color table
    ... Use GetDIBits to obtain an array of bits for your bitmap. ... If speed is not an issue, you may use GetPixel to obtain individual pixels. ... relative contributions of red, green and blue. ...
    (microsoft.public.win32.programmer.gdi)