Jump to content
  • Advertisement
Sign in to follow this  
jcr83

C#, Flash as bitmap is working but performance tips?

This topic is 4856 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I got flash working onto a bitmap, but the performance of it is very slow. I got an fps of 6 frames per second but I like to get a performance of 30. Anyone got any tips. Ohh i got flash on a bitmap using oledraw and bitblt using C#. If anyone needs the code pm me. Greetz, Johan Reitsma

Share this post


Link to post
Share on other sites
Advertisement
Hi,

isn't it possible to simply render the frames in advance, and play the pre-rendered images at 30 FPS?

kp

Share this post


Link to post
Share on other sites
Without a lot more detail, I'd say you're stuck with micro-optimization. That process sounds a bit performance-horrific ... mixing GDI and D3D is often a little painful in this respect [smile]

Things to check:

1. can you store/cache handles to resources?
- Is each oledraw/bitblt creating/re-creating GDI resources?

2. are you loading the entire file yourself, or is something else doing it?
- Is it doing anymore work than it has to?

3. At your end - are you handling/writing your resources as efficiently as possible?
- could you manually optimize/overwrite the bitblt/DC conversion?
- do the formats match up? converting pixel formats is expensive.

On the original mention of detail... have you got a profiler? if not, why not? [smile]

When doing performance tuning on something like this you need to know exactly where you're burning CPU time. Otherwise you're fumbling round in the dark hoping to get a lucky break by changing the right thing [lol]

hth
Jack

Share this post


Link to post
Share on other sites
The following processes are taking to much time

IntPtr hdc = graphics.GetHdc();
OleDraw(ibrowser.GetOcx(), 1, hdc, ref Rect);
graphics.ReleaseHdc(hdc);

the time taken for this processes are to much and so i get a low fps. How bigger the rectange (Rect) how more time it takes. Taking smaller samples doesn't help neither.


ibrowser is in this case a AxSHDocVw.AxWebBrowser();

This is completly done in C#.

Share this post


Link to post
Share on other sites
At the risk of sounding rather ignorant, is it necessary to "GetHDC" and "release" it everytime you do a oledraw? What if you do a GetHDC once during initialisation and cache it, releasing it only when you are done with everything? Similarly for "GetOCX", do you need to do this everytime you do a oledraw? Again, caching *may* help...

Oh wait, I think that's precisely what jolly is referring to in his first point. Clever chap. :D

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!