Viewport Question and Something not implementent?

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

Guest

Hello,

I am using .NET 2.0 and building a custom control. There are multiple
graphics elements that I would like to render on the surface. When drawn
together they form the complete control image but need to be managed
separately because they might have different scale, units, move indendently,
and are updated at different times for different reasons.

My idea was to maintain several buffers or graphics objects that I could use
draw into and load images as they needed updating. Because the total image
is larger then the control - I was planning to copy regions of the larger in
memory images onto the control surface - like a viewport. Because of how the
images need to be scrolled I cannot use the Autoscroll feature of the
UserControl.

I am very familiar with how to do this in unmanaged C++ but am not sure the
best way in .NET 2.0 - the best type of objects to maintain the managed
graphics and the best way to copy a region of them to the UserControl surface
as the user scrolls. I could use Image, Bitmaps, or Graphics objects but
there are limitations (and what I think might be performance hits) with the
numerous conversions that would be required. I would prefer not go to
DirectX as I don't think my performance needs are that high.

Any suggests / best practices?

Also,

When I first ran the following line of code I got a NotImplementedException
thrown:

e.Graphics.DrawImage(m_GridPlane, m_DestRect, sourceRect, GraphicsUnit.Inch);

Just as a test I changed it to GraphicsUnit.Pixel and although the painting
was obviously wrong - it worked.

There is no mention of this not being implemented in the docs - am I missing
something?

Any suggestions?

THANKS!!
 
Back
Top