Intrepid
Intrepid

Reputation: 2831

Creating graphics region

I want to create a drawable region within a user control of the following dimensions:

x=0, y=100, width=(UserControl.Width), height=(UserControl.Height-100).

The reason for this is so that the client area of the region starts at 0,0 and would help to make it easier to draw shapes relative to the client region and not have to worry about subtracting 100 from the height.

As I am drawing directly on the user control using C# and Visual Studio 2012, is there any built-in class that I can use to create a client region that can be draw on?

Upvotes: 0

Views: 563

Answers (1)

Hans Passant
Hans Passant

Reputation: 941218

Just use e.Graphics.TranslateTransform(0, 100) in your paint event handler to offset the drawing.

Upvotes: 1

Related Questions