SetWindowExt and SetViewportExt in C#

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Does C# have equivalent of any of the following functions

SetWindowExt, SetViewportExt and SetViewportOrg

If not, i guess the only way is to call the API. Is it straight forward like calling API or have to import some lib etc

Thank
Irfan
 
Hi Irfan,
If you what different kind of coordinate mappings take a look at
Graphics.PageUnit and Graphics.PageScale

for example if you want to draw in inches
grfx.PageUnit = GraphicsUnit.Inch;
grfx.PageScale = 1;

or

grfx.PageUnit = GraphicsUnit.Millimeter;
grfx.PageScale = 25.4;

or

grfx.PageUnit = GraphicsUnit.Document;
grfx.PageScale = 300;

If you want to move the origin you can use Graphics.TranslateTransform(...)
method.

If you want to change axes directions you can use
grfx.ScaleTransform(...) e.g grfx.ScaleTransform(-1, 1)

Anyway, you can do very complex transformations using Graphics object
methods and properties

--
HTH
B\rgds
100 [C# MVP]
Irfan Younus said:
Does C# have equivalent of any of the following functions.

SetWindowExt, SetViewportExt and SetViewportOrg.

If not, i guess the only way is to call the API. Is it straight forward
like calling API or have to import some lib etc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top