none
about get pixel RRS feed

  • Question

  • Hi:

    since graphic.FillRectangle can fill the object section, could we get the pixel from an given bounds of the 

    bmp, and using this pixel or section to fill the other section. Thanks.

    Tuesday, March 6, 2012 1:55 AM

Answers

  • Yes, it's possible. It means draw with pattern.

    TextureBrush texturedBrush =
      new TextureBrush( textureBitmap );
      graphicsObject.FillRectangle( texturedBrush, 155, 30, 75, 100 );

    DrawingShapes


    Regards, Nighting Liu

    Tuesday, March 6, 2012 2:40 AM
  • Yes.  It is possible in 2 steps.

    1. Convert graphics to Bitmap

    2. Use GetPixel() method of Bitmap

                Bitmap bitmap = new Bitmap(100, 100, graphics);
                bitmap.GetPixel(1, 1);
    


    Resolving n Evolving in C# (http://jeanpaulva.com)

    Tuesday, March 6, 2012 7:01 AM

All replies

  • Yes, it's possible. It means draw with pattern.

    TextureBrush texturedBrush =
      new TextureBrush( textureBitmap );
      graphicsObject.FillRectangle( texturedBrush, 155, 30, 75, 100 );

    DrawingShapes


    Regards, Nighting Liu

    Tuesday, March 6, 2012 2:40 AM
  • Yes.  It is possible in 2 steps.

    1. Convert graphics to Bitmap

    2. Use GetPixel() method of Bitmap

                Bitmap bitmap = new Bitmap(100, 100, graphics);
                bitmap.GetPixel(1, 1);
    


    Resolving n Evolving in C# (http://jeanpaulva.com)

    Tuesday, March 6, 2012 7:01 AM