Tag Archives: Bitmap

Set the pixels in a WPF bitmap in C#

This example shows how you can manipulate the pixels in a WPF bitmap. One of the things I like least about WPF is the way Microsoft threw away everything we had learned over years of working with Visual Studio. Yes, … Continue reading

Posted in graphics, image processing, wpf, XAML | Tagged , , , , , , , , , , , , , | 5 Comments

Render text onto a RenderTargetBitmap with WPF and C#

In earlier examples such as Easily render rotated text in a WPF program using C#, I explained how to render text in a WPF program. Those examples draw text on the program’s window at runtime. Sometimes you may want to … Continue reading

Posted in drawing, graphics, image processing, wpf, XAML | Tagged , , , , , , , , , , , , , , , | 3 Comments

Draw on a bitmap in C#

This example shows how you can draw on a bitmap and display the result on a form. The example Draw in a Paint event handler in C# shows how to draw in a form’s Paint event handler. This is simple, … Continue reading

Posted in drawing, graphics | Tagged , , , , , , , , , , , | 4 Comments

Use the Bitmap class’s RotateFlip method to easily flip and rotate an image in C#

The Bitmap class’s RotateFlip method makes it easy to rotate an image by a multiple of 90 degrees and flip it vertically or horizontally. This example wraps the call to RotateFlip in the following ModifiedBitmap method. It makes a copy … Continue reading

Posted in graphics, image processing | Tagged , , , , , , , , , , , , , , | Leave a comment

Use the Bitmap32 class to manipulate image pixels very quickly in C#

The following posts explain how you can build a Bitmap24 class to manipulate the pixels in 24-bit images very quickly. Use the Bitmap24 class to manipulate image pixels very quickly in C# Add GetPixel and SetPixel methods to the Bitmap24 … Continue reading

Posted in graphics, image processing | Tagged , , , , , , , , , , , , | 9 Comments

Add GetPixel and SetPixel methods to the Bitmap24 class in C#

This example adds GetPixel and SetPixel methods to the Bitmap24 class described in the post Use the Bitmap24 class to manipulate image pixels very quickly in C#. Unfortunately that class only allows you manipulate pixel values in a one-dimensional byte … Continue reading

Posted in graphics, image processing | Tagged , , , , , , , , , , , , | 1 Comment

Use the Bitmap24 class to manipulate image pixels very quickly in C#

The Bitmap class’s GetPixel and SetPixel methods let you easily manipulate image pixels. They’re easy to use, but they’re also relatively slow. This program inverts the pixels in an image several times. When you click the No Lock Bits button, … Continue reading

Posted in graphics, image processing | Tagged , , , , , , , , , , , , , | 5 Comments

Load images without locking their files in C#

This example shows how to load images into a C# program without locking their files. When you click the Load Normally button, the program uses the following code to display an image file. // Load the image normally. private void … Continue reading

Posted in files, graphics | Tagged , , , , , , , , , , , , , , | 9 Comments