![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I am a maths teacher and I want to make java-applet like math applets in win32 platform. I studied GDI+ in VB.Net. My problem is: For example, I want to move a line by dragging with mouse or I want to animate some sine or cosine curves. When I animate or move, I must clear the previous lines or shapes, and it flickers. How can I overcome this problem and obtain smooth better profesional animations? Can someone please help me? *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#3
| |||
| |||
|
|
I am a maths teacher and I want to make java-applet like math applets in win32 platform. I studied GDI+ in VB.Net. My problem is: For example, I want to move a line by dragging with mouse or I want to animate some sine or cosine curves. When I animate or move, I must clear the previous lines or shapes, and it flickers. How can I overcome this problem and obtain smooth better profesional animations? Can someone please help me? *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#4
| |||
| |||
|
|
Flickering can be killed by using double buffering. Windows Forms applications and controls can set a style bit that enables automatic double buffering. See my 8th June post entitled "Aniamtion in GDI+ with double buffering" for full details and a demo application. -- Bob Powell [MVP] C#, System.Drawing Check out the GDI+ FAQ http://www.bobpowell.net/gdiplus_faq.htm Buy quality Windows Forms tools http://www.bobpowell.net/xray_tools.htm Get the NEW must-have UI component. The .NET RectTracker Enables CRectTracker like functionality for WindowsForms. User defined layouts are a breeze. http://www.bobpowell.net/recttracker.htm "Mehmet Ozyurt" <anonymous (AT) devdex (DOT) com> wrote in message news:#Sk9g4hPDHA.3664 (AT) tk2msftngp13 (DOT) phx.gbl... I am a maths teacher and I want to make java-applet like math applets in win32 platform. I studied GDI+ in VB.Net. My problem is: For example, I want to move a line by dragging with mouse or I want to animate some sine or cosine curves. When I animate or move, I must clear the previous lines or shapes, and it flickers. How can I overcome this problem and obtain smooth better profesional animations? Can someone please help me? *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#5
| |||
| |||
|
|
Hi All, Bob, I appreciate Your ideas of using double-buffering, however, to my knowledge it does not solve perfomance problem as it lies in lack of hardware support in GDI+. Because of that one would encounter tremendous slowdowns in double-buffering mode while using GDI+ (there are few posts on that problem here). That's why I moved to DirectX, and to my knowledge you use it as well to get up to speed (your other posts here and there). Obviously I would not recommend for begginners to do that, however, some experience with programming should be sufficient to cope with DirectDraw namespace classess and functions. I have not tested Ken idea of using bitmap as a drawing target but its tempting one - has anyone compared perfomance of this technique to DirectX - 10 fold penalty would be fine for many apps. performer24 Użytkownik "Bob Powell [MVP]" <bob (AT) _spamkiller_bobpowell (DOT) net> napisał w wiadomości news:elK7AQjPDHA.1720 (AT) TK2MSFTNGP11 (DOT) phx.gbl... Flickering can be killed by using double buffering. Windows Forms applications and controls can set a style bit that enables automatic double buffering. See my 8th June post entitled "Aniamtion in GDI+ with double buffering" for full details and a demo application. -- Bob Powell [MVP] C#, System.Drawing Check out the GDI+ FAQ http://www.bobpowell.net/gdiplus_faq.htm Buy quality Windows Forms tools http://www.bobpowell.net/xray_tools.htm Get the NEW must-have UI component. The .NET RectTracker Enables CRectTracker like functionality for WindowsForms. User defined layouts are a breeze. http://www.bobpowell.net/recttracker.htm "Mehmet Ozyurt" <anonymous (AT) devdex (DOT) com> wrote in message news:#Sk9g4hPDHA.3664 (AT) tk2msftngp13 (DOT) phx.gbl... I am a maths teacher and I want to make java-applet like math applets in win32 platform. I studied GDI+ in VB.Net. My problem is: For example, I want to move a line by dragging with mouse or I want to animate some sine or cosine curves. When I animate or move, I must clear the previous lines or shapes, and it flickers. How can I overcome this problem and obtain smooth better profesional animations? Can someone please help me? *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#6
| |||
| |||
|
|
Hello, You're right to say that double buffering reduces the performance of an application and in this case, the use of double buffering is specifically to reduce an annoying flicker. I have indeed used DirectX to good effect in conjunction with Windows Forms, specifically to increase blitting performance. DirectX blits are 10-20 times faster than GDI+ blits under certain circumstances. The ideal situation for using DX blitting is when you have to blit without stretching. Whenever the source and destination rectangles are different sizes, DirectX seems to be even slower than GDI+, at least on my machine. Unfortunately, there are some serious bugs in the framework wrappers for both DirectX and GDI+ that really mess up a graphics programmers life. Bug 1 is the inability of the DirectDraw Surface to lock the image array correctly. This means that some routines that directly manupulate the bitmap data are not possible under .NET. Bug 2 is in the Region.GetRegionScans method which means that it's not possible to use a GDI+ region for clipping a DirectDraw surface. I figure that if I do my off screen drawing at the speed of GDI+ and then blit the final image to the screen in 1/20th of the time, thats still a pretty good performance increase. |
#7
| |||
| |||
|
|
Hi Marjie, I would suggest asking this question over in the microsoft.public.win32.directx.managed group. -- |
#8
| |||
| |||
|
|
Hello, You're right to say that double buffering reduces the performance of an application and in this case, the use of double buffering is specifically to reduce an annoying flicker. I have indeed used DirectX to good effect in conjunction with Windows Forms, specifically to increase blitting performance. DirectX blits are 10-20 times faster than GDI+ blits under certain circumstances. The ideal situation for using DX blitting is when you have to blit without stretching. Whenever the source and destination rectangles are different sizes, DirectX seems to be even slower than GDI+, at least on my machine. Unfortunately, there are some serious bugs in the framework wrappers for both DirectX and GDI+ that really mess up a graphics programmers life. Bug 1 is the inability of the DirectDraw Surface to lock the image array correctly. This means that some routines that directly manupulate the bitmap data are not possible under .NET. Bug 2 is in the Region.GetRegionScans method which means that it's not possible to use a GDI+ region for clipping a DirectDraw surface. I figure that if I do my off screen drawing at the speed of GDI+ and then blit the final image to the screen in 1/20th of the time, thats still a pretty good performance increase. -- Bob Powell [MVP] C#, System.Drawing Check out the GDI+ FAQ http://www.bobpowell.net/gdiplus_faq.htm Buy quality Windows Forms tools http://www.bobpowell.net/xray_tools.htm Get the NEW must-have UI component. The .NET RectTracker Enables CRectTracker like functionality for WindowsForms. User defined layouts are a breeze. http://www.bobpowell.net/recttracker.htm "performer24" <performer24 (AT) konto (DOT) pl> wrote in message news:uF2SUtHQDHA.2700 (AT) tk2msftngp13 (DOT) phx.gbl... Hi All, Bob, I appreciate Your ideas of using double-buffering, however, to my knowledge it does not solve perfomance problem as it lies in lack of hardware support in GDI+. Because of that one would encounter tremendous slowdowns in double-buffering mode while using GDI+ (there are few posts on that problem here). That's why I moved to DirectX, and to my knowledge you use it as well to get up to speed (your other posts here and there). Obviously I would not recommend for begginners to do that, however, some experience with programming should be sufficient to cope with DirectDraw namespace classess and functions. I have not tested Ken idea of using bitmap as a drawing target but its tempting one - has anyone compared perfomance of this technique to DirectX - 10 fold penalty would be fine for many apps. performer24 Użytkownik "Bob Powell [MVP]" <bob (AT) _spamkiller_bobpowell (DOT) net> napisał w wiadomości news:elK7AQjPDHA.1720 (AT) TK2MSFTNGP11 (DOT) phx.gbl... Flickering can be killed by using double buffering. Windows Forms applications and controls can set a style bit that enables automatic double buffering. See my 8th June post entitled "Aniamtion in GDI+ with double buffering" for full details and a demo application. -- Bob Powell [MVP] C#, System.Drawing Check out the GDI+ FAQ http://www.bobpowell.net/gdiplus_faq.htm Buy quality Windows Forms tools http://www.bobpowell.net/xray_tools.htm Get the NEW must-have UI component. The .NET RectTracker Enables CRectTracker like functionality for WindowsForms. User defined layouts are a breeze. http://www.bobpowell.net/recttracker.htm "Mehmet Ozyurt" <anonymous (AT) devdex (DOT) com> wrote in message news:#Sk9g4hPDHA.3664 (AT) tk2msftngp13 (DOT) phx.gbl... I am a maths teacher and I want to make java-applet like math applets in win32 platform. I studied GDI+ in VB.Net. My problem is: For example, I want to move a line by dragging with mouse or I want to animate some sine or cosine curves. When I animate or move, I must clear the previous lines or shapes, and it flickers. How can I overcome this problem and obtain smooth better profesional animations? Can someone please help me? *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#9
| |||
| |||
|
|
-----Original Message----- Hi, Draw on a bitmap then draw the bitmap on the screen. Ken ------------ "Mehmet Ozyurt" <anonymous (AT) devdex (DOT) com> wrote in message news:%23Sk9g4hPDHA.3664 (AT) tk2msftngp13 (DOT) phx.gbl... I am a maths teacher and I want to make java-applet like math applets in win32 platform. I studied GDI+ in VB.Net. My problem is: For example, I want to move a line by dragging with mouse or I want to animate some sine or cosine curves. When I animate or move, I must clear the previous lines or shapes, and it flickers. How can I overcome this problem and obtain smooth better profesional animations? Can someone please help me? *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! . |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |