C#, Flash as bitmap is working but performance tips?
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
Hi,
isn't it possible to simply render the frames in advance, and play the pre-rendered images at 30 FPS?
kp
isn't it possible to simply render the frames in advance, and play the pre-rendered images at 30 FPS?
kp
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
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
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#.
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#.
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
Oh wait, I think that's precisely what jolly is referring to in his first point. Clever chap. :D
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement