Tag Archives: scale

Use the mouse wheel to scale an image in C#

This example lets you use the mouse wheel to zoom in and out on an image. To use the mouse wheel, the program needs to catch the MouseWheel event. Unfortunately that event isn’t listed in the Form Designer so you … Continue reading

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

Drag a map to scroll in C#

This example shows how you can allow a user to drag a map to scroll to hidden parts of it. Scroll bars provide a simple method for allowing the user to view parts of a map that don’t fit on … Continue reading

Posted in drawing, graphics, image processing, mathematics | Tagged , , , , , , , , , , , , , , , | 3 Comments

Define map hotspots in C#

The example Display a scalable map with hotspots in C# uses a list of hotspots defined by the following code. // The hotspots. private List Hotspots = new List(); … // Prepare the map for first viewing. private void Form1_Load(object … Continue reading

Posted in algorithms, graphics, mathematics | Tagged , , , , , , , , , , , , , | Leave a comment

Display a scalable map with hotspots in C#

Making a scalable map with hotspots is surprisingly easy, although getting the details right is a bit tricky. The program displays a map at several different scales. If the map won’t fit on the form at the current scale, it … Continue reading

Posted in algorithms, graphics, mathematics | Tagged , , , , , , , , , , , , , | 5 Comments

Map drawing coordinates without distortion in C#

The post Easily map drawing coordinates in C# lets you easily map a rectangle in drawing coordinates to a rectangle in device coordinates. Often, however, you’ll want to ensure that the drawing area isn’t distorted. In other words, you don’t … Continue reading

Posted in algorithms, drawing, graphics, mathematics | Tagged , , , , , , , , , , , , , , , , , , , , , | 1 Comment

Easily map drawing coordinates in C#

The example Map points between coordinate systems in C# shows several ways you can map drawing coordinates to screen coordinates. They all work but these sorts of coordinate conversions are really common if you’re doing more advanced graphics so I … Continue reading

Posted in drawing, graphics, transformations | Tagged , , , , , , , , , , , , , , , , , , , | 1 Comment

Draw round circles in scaled coordinate systems in C#

In other posts I explain how you can use transformations to draw objects in a coordinate system other than the one provided “natively” by a PictureBox, Bitmap, and other objects that support drawing. Basically a transformation (represented by a Matrix … Continue reading

Posted in drawing, graphics, mathematics | Tagged , , , , , , , , , , , , , , , | Leave a comment

Let the user zoom on a picture in C#

The example Provide autosave in C# explains how to make a program that lets the user draw lines in different colors and styles. That program lets the user undo and redo, save and load drawings, and autosaves so it can … Continue reading

Posted in drawing, files, graphics, serialization | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

Map points between coordinate systems in C#

This example shows how you can easily map points between different coordinate systems. The Graphics object provides transformations that let you scale, translate, rotate, skew, and otherwise transform graphics as you draw them. One important use of these transformations is … Continue reading

Posted in algorithms, drawing, graphics, transformations | Tagged , , , , , , , , , , , , , , , , , , | 2 Comments

Zoom on a graph in WPF and C#

It’s remarkably easy to zoom on a graph in WPF. This example extends the example Let the user click on graph points in WPF and C#. To modify the previous version, you first need to rebuild the user interface a … Continue reading

Posted in algorithms, drawing, geometry, graphics, mathematics | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | 2 Comments