Re: Layering in Windows Forms

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Whether you plan for a system with Z order or not, you must store the
objects in a certain order and then paint them in a certain order, unless
you try very hard not to, so Z order is a given.


--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.



<vikash@xxxxxxxxxxx> wrote in message
news:1151658127.468628.316890@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi Bob,

Thanks for your valuable inputs.

Yeh i was trying with the Transparent control but was really getting
lots of weired things hapenning specially when it comes to redrawing.

I think the only good approach is to go for the own data structure and
we can make it smart.

One thing when talk abt Z - Order, do u mean the order of the objects
drawn on Graphics as all the graphics objects are stateless and i dont
find if there is the option to maintain the Z- order for the same like
we have for the Windows Controls.

Also, will it be nice to use the WinFx WPF for the same?? i think it
provides a lots of feature. What u say abt it?

Thnanks
Vikash

Bob Powell [MVP] wrote:
Stay away from transparent controls. You'll enter into a world of pain if
you don't

The only thing you need to worry about is Z order and painters algorithm
is
fine for this application.

Remember that your objects can have transparency and still be in a list
of
apparently flat objects. See my animation example which is itself a
retained
mode system for inspiration.

Failing that advice, go download the WPF community preview ;-)

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.



<vikash@xxxxxxxxxxx> wrote in message
news:1151579860.199987.295030@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi Bob,

Thanks for the suggestion.

I was going through the retained mode graphics system that talks about
saving the things painted to the window and repaint the same whenever
it need to be painted. The smart way we can do it to paint the things
only when it is needed to be painted.

For the layering yr suggestion is to save the objects as 2-d collection
where the first dimension will be the layer and the second will be the
objects collection in that layer.

So it will not be any thing physical on the form itself reather it will
form the logical layers at the development level.

I was thinking of using the transparent COntrols for each layer -- what
u say abt this?? will that be useful with resect to the performance and
will it be advantageous to use. I was thinking to have the user
controls, at different layers as i might be intested to invalidate the
particular area of particular control only -- insted of repainint the
particular area for all the layers.

It will be help ful you can really provide your valuable comments on
the same.

THnaks
Vikash

With repect to the layering, i was more afraid as
Bob Powell [MVP] wrote:
See the GDI+ FAQ for articles on retained mode graphics systems.

A layered system uses much the same technique except that instead of
one
collection of drawable objects you would have a collection of
collections.
one list for each layer.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.



<vikash@xxxxxxxxxxx> wrote in message
news:1151506244.884016.214520@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,

I want to develop a windows based application using .Net 2.0

The application will have the heavy UI and it will have the lots of
drawing to do on the form.

So can any one give me the direction how can i handle the different
issues that will arise in the same due to paint event and due to
other
issues.

Also i want to have the layer concept in the same .e.g we have
something in Adobe Photoshop. so that the user can categorize the
items
for the layers. also user should be able to on - off the layer and
should be able to change the order of layers.

So can any one suggest me what can be the good way to do the same.

Thanks

Vikash





.



Relevant Pages

  • Re: Custom Zoom & Performance
    ... Find great Windows Forms articles in Windows Forms Tips and Tricks ... Answer those GDI+ questions with the GDI+ FAQ ... the scaled pixel ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: Printing graphics/text that span multiple pages
    ... Find great Windows Forms articles in Windows Forms Tips and Tricks ... Answer those GDI+ questions with the GDI+ FAQ ... You need to figure out how many pages you need and then render your ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: Hotspots in graphic
    ... Find great Windows Forms articles in Windows Forms Tips and Tricks ... Answer those GDI+ questions with the GDI+ FAQ ... > What is the best way to draw that image on the screen? ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Re: Hotspots in graphic
    ... Find great Windows Forms articles in Windows Forms Tips and Tricks ... Answer those GDI+ questions with the GDI+ FAQ ... > What is the best way to draw that image on the screen? ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Re: Drawing backgeound image slows down form performance
    ... Find great Windows Forms articles in Windows Forms Tips and Tricks ... Answer those GDI+ questions with the GDI+ FAQ ... > I have a windows form application that draws the background with a color ...
    (microsoft.public.dotnet.framework.drawing)