Re: Layering in Windows Forms
- From: "Bob Powell [MVP]" <bob@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 30 Jun 2006 19:04:15 +0200
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
.
- References:
- Layering in Windows Forms
- From: vikash
- Re: Layering in Windows Forms
- From: Bob Powell [MVP]
- Re: Layering in Windows Forms
- From: vikash
- Re: Layering in Windows Forms
- From: Bob Powell [MVP]
- Re: Layering in Windows Forms
- From: vikash
- Layering in Windows Forms
- Prev by Date: Re: Layering in Windows Forms
- Previous by thread: Re: Layering in Windows Forms
- Next by thread: Memory leak/problems when printing TIFF images (VS2005)
- Index(es):
Relevant Pages
|