|
-
Jan 15th, 2009, 01:04 PM
#1
[RESOLVED] DC performance
Hai all,
i have a timer with 1 interval and it keep bitblt'ing screen in to a memory dc.
my question is,
do i need to create and delete the memory dc on each interval or better i i create the dc at form load and keep bitblt on to it and delete it on forum unload.
-
Jan 15th, 2009, 01:10 PM
#2
Re: DC performance
2nd option seems better
-
Jan 15th, 2009, 01:13 PM
#3
Re: DC performance
Hai pradeep,
Thanks for the answer.
let me see few other openions also
-
Jan 15th, 2009, 01:31 PM
#4
Re: DC performance
pradeep, ar you sure the second option is the best solution?
if i tried, out of memory occours
-
Jan 15th, 2009, 01:47 PM
#5
Re: DC performance
Fazi show us your code, It sounds like you might be forgetting to destroy some GDI objects.
Like PraDeep, I would keep the DC and the Bitmap alive for the duration, but at the end of the day I don't think there is much in it either way.
-
Jan 15th, 2009, 01:55 PM
#6
Re: DC performance
Milk, seems yes,
let me check it then.
-
Jan 15th, 2009, 01:57 PM
#7
Re: DC performance
 Originally Posted by Milk
Fazi show us your code, It sounds like you might be forgetting to destroy some GDI objects.
Like PraDeep, I would keep the DC and the Bitmap alive for the duration, but at the end of the day I don't think there is much in it either way.
Agreed as long as we are only talking about a couple of DCs. Where people go overboard is when they have like 100 images and also have 100 DCs -- waste of resources when only a one or two DCs are needed at any one time; sometimes a few more depending on situations.
-
Jan 15th, 2009, 02:19 PM
#8
Re: DC performance
yes milky, your correct.
GetDc has been called on every second and not released. a lam bug.
now i put it to form load as you and predeep suggessed earlier to keep it though out the session and distroyed at the unload of form.
-
Jan 15th, 2009, 03:07 PM
#9
Re: DC performance
 Originally Posted by LaVolpe
Where people go overboard is when they have like 100 images and also have 100 DCs
Yes, and from the top of my head the most I could conceive using would be 3.
Fazi, is your timer running at interval 1 or 1000?
-
Jan 15th, 2009, 03:13 PM
#10
Re: [RESOLVED] DC performance
1 and now made it to 100 y milk?
-
Jan 15th, 2009, 03:18 PM
#11
Re: [RESOLVED] DC performance
Only because I thought you meant 1 and then you mentioned a second which would tip the balance for me making me more inclined to create the DC each time, basically because it would be just sitting there doing nothing for 99% of the time. It's much of a muchness anyway.
Good luck with your prog
-
Jan 16th, 2009, 12:32 AM
#12
Re: [RESOLVED] DC performance
yah it was just 1 ms only. now it is 100 ms,
Thank you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|