|
It does have such features, plus an API, although I don't know if they are present in the community version.
|
|
|
|
|
Can someone give a a good explanation of what DoubleBuffering is. Also while I am making requests , since the String data type is immutable(Am I correct?) is there a mutable data type like StringBuffer available in C# like there is in other languages? Someone clear me up on this. Thanks.
Nick Parker
|
|
|
|
|
System.Text.StringBuilder
|
|
|
|
|
In short, double buffering is the act drawing to an off-screen graphics context and then blitting it to the screen in one action. Sorry No time for a good explanation.
|
|
|
|
|
DoubleBuffering is a common graphics drawing algorithm. Basically, you "draw" everything in a bitmap in memory. When a screen refresh occurs, you put your drawn bitmap on the video memory.
This way, you avoid partially drawn frames: they are ugly and kills action and animation on a game or multimedia app, for example. Even a common form on the screen can be improved with doublebuffering, because the app appears to be faster and more responsive. Movement with double buffering usually is very smooth.
But there is no free lunch. First, you have two writes and a performance hit: one write on main memory, second a data transfer to the video card (ok, normally very fast).
Second problem: because you only transfer the buffer to screen when it's drawn, performance falls at fractions of video refresh speed.
E.g: you make a simple animation and double buffer to a 60Hz video mode. So, you get 60 FPS (frames per second). So, you start adding more details to each frame and keeping 60FPS. Suddenly, you add a little more detail and animation falls to 30FPS. A little more and 15FPS. A little more and 7 FPS. So, your very responsive app can become a slow one.
I'm not sure (because of my english) if I was clear enough. There are (lots of) other animation algorithms and some workarounds to the problems I told you, but the basic issues are those.
Crivo
Automated Credit Assessment
|
|
|
|
|
Thanks that was a great explanation really, very well put.
Nick Parker
|
|
|
|
|
I have create a custom Windows form control and enabled the built in double buffering with:
this.SetStyle(ControlStyles.DoubleBuffer & ControlStyles.UserPaint & ControlStyles.AllPaintingInWmPaint, true);
but this does not help my flicker problem at all... From what I have read that will work in controls, Right?.?.
Joshua Guy Sonork ID: 100.9944
ICQ: 519642
Hotmail: JoshuaJGuy@hotmail.com
|
|
|
|
|
this.SetStyle(ControlStyles.DoubleBuffer | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true);
|
|
|
|
|
DOH! Well that was part of my problems, but even with that it still flickers like crazy. I have that enabled in my Windows Form control and the parent form. Any other suggestions?
Joshua Guy Sonork ID: 100.9944
ICQ: 519642
Hotmail: JoshuaJGuy@hotmail.com
|
|
|
|
|
Are you doing all your drawing during the Paint event?
Thats the only time that the double-buffering is actually used.
James
Simplicity Rules!
|
|
|
|
|
It's all in the Paint event. To make things worse. I copied and pasted all my code into a form and it works like a charm. I'll dig in more into the control but something isn't right with that.
Joshua Guy Sonork ID: 100.9944
ICQ: 519642
Hotmail: JoshuaJGuy@hotmail.com
|
|
|
|
|
DOH! It was so stupid I won't even admit what I did.
Joshua Guy Sonork ID: 100.9944
ICQ: 519642
Hotmail: JoshuaJGuy@hotmail.com
|
|
|
|
|
But you must tell us, if not for us do it for the children; think of the children who may fall into the same trap you did.
James
Simplicity Rules!
|
|
|
|
|
If you must know.
I posted the message with the following code:
this.SetStyle(ControlStyles.DoubleBuffer & ControlStyles.UserPaint & ControlStyles.AllPaintingInWmPaint, true);
Which of course would not enable the double buffering.
Neil points out my stupid mistake(which I originally had in my other test form, but a monkey came along and changed all the |'s to &'s as a nasty joke, so as you see this was clearly the monkeys fault not mine)
this.SetStyle(ControlStyles.DoubleBuffer | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true);
So I see Neil'd observation and hit myself. Well evidently I hit my self so hard that when I went to change it I went into the source of my dummy app in which I was testing the control. So the parent form was double buffered correctly. Thinking that I had enabled it in my control I was sad. So I left it alone until now. And after a break and looking in my code again I relize that the monkeys &'s had not be changed to |'s... If it weren't for the monkey I would have been set.
Joshua Guy Sonork ID: 100.9944
ICQ: 519642
Hotmail: JoshuaJGuy@hotmail.com
|
|
|
|
|
Damned dirty monkeys
James
Simplicity Rules!
|
|
|
|
|
LOL, I hate it when I do that... , Errr, The monkeys I mean...
|
|
|
|
|
using xml, i need to have a wizard (add-in or ui-less control) generate controls and place them on the form.
for instance, the xml reads:
<code>
<controls>
<control tag="DB_COLUMN_NAME">
<name value="Sample"/>
<type value="MyLib.Controls.TextWithLabel"/>
<label value="My Sample"/>
<defaultText value="Enter Text Here"/>
<size>
<width value="200"/>
<height value="34"/>
</size>
. . .
</control>
</controls>
</code>
so when this control loads this xml, it creates a 'TextWithLabel' control and places it on the form as if the user drew the control from the toolbox.
this is a hard topic to search for and i would appreciate any good books/articles on Generative UI development. *like this or more hardcore only please*
|
|
|
|
|
Why don't u use XSL, it's perfect for such task (controls is a pseudo-hierarchical recorset in fact & is enough flat to avoid dirty case).
You should asso look native format .resx (see resgen.exe) which the XML schema of microsoft form. Other tracks:
* Configuration
* Visual Inheritance
* Designer
good luck
|
|
|
|
|
How to convert? (varius methods if possible, please)
|
|
|
|
|
Using atoi will work:
CString str = "42";
int i = atoi(str);
Cheers,
Tom Archer
Author, Inside C#
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
|
|
|
|
|
it would be cool
|
|
|
|
|
You might even be able to do this through PInvoke, but I wouldn't necessarily recommend it I think I'll stick with "What is Convert?", Alex
Cheers,
Tom Archer
Author, Inside C#
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
|
|
|
|
|
OOOPS!!!!! I've been in the MFC forum all day and my head is still in that
Use the Convert static functions to do what you want.
string s = "42";
int i = Convert.ToInt32(s);
Cheers,
Tom Archer
Author, Inside C#
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
|
|
|
|
|
What's the difference between convert and parse.
string s = "42";
int i = int32.parse(s);
|
|
|
|
|
Parse is specific to the Int32 class while Convert is a generic class supporting all types.
Cheers,
Tom Archer
Author, Inside C#
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
|
|
|
|