|
I wanted to display a GIF animation in a MFC SDI application.
I'm using a thread to draw frame by frame into the window.I want to
delete old frame and redraw the window.
I used DrawImage (-,-,---) GDI+ Image class function to draw a frame.
But when I use InvalidateRect() method. Window is start to flick after
each frame is drawn
how do I solve this.
Thilani
|
|
|
|
|
|
I'm getting into some user interface and this is a clear, concise explanation of what I needed..
Thankyou (and a 5).
Elaine
The tigress is here
|
|
|
|
|
You should mention that to use this code in the OnPaint method of a CDialog derived class you should also override the OnEraseBkgnd method to look like this:
BOOL JpegPannel::OnEraseBkgnd(CDC* pDC)<br />
{<br />
<br />
return false;
}
otherwise the code had no effect on the flickering.
Otherwise Great post.
--------------------------------------------
I wish people would stop slagging each other off on these forums and keep there posts to technical issues.
|
|
|
|
|
Does BitBlt() overwrites all the bits to the destination dc or is there any thing special that transfers only modified bits...
or is it simply a mem to mem transfer that makes it fast..?
what happens inside.. can u explain?
ahmed
|
|
|
|
|
1).Leak found after the last line you want to add:
ReleaseDC(pDC);
ReleaseDC(&MemDC);
2)and modify
CBitmap *pOldBitmap = MemDC.SelectObject(&MemBitmap);
to
CBitmap *pOldBitmap = (CBitmap*) MemDC.SelectObject(&MemBitmap);
Only during extreme testing would one find this problem so
I'm not surprised many of the guru wantabees did not catch this.
squid
|
|
|
|
|
Actually, the problem is that I was using W2000 back then, which catches these leaks. Still, I knew about the problem, so my bad. I wonder why I never got an email to tell me about this comment ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Oh - not my article. That explains it then.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
I'm using it and it works great! I have a leak somewhere but perhaps it's in my code. I appreciate this code because it very easy to follow, and it's not the type of code that only MIT Grads would understand. Most of the code published by so called guru's is junk that most people would not understand anyway.
Keep it up.
squid
|
|
|
|
|
squid wrote:
Most of the code published by so called guru's is junk that most people would not understand anyway.
I humbly submit that 'most people' do not know how to program, and that this is not the fault of the few that do.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Christian Graus wrote:
I humbly submit that 'most people' do not know how to program, and that this is not the fault of the few that do.
IF you THINK that you are the only guy who knows programming, think deeply
again. Who the hell do u think u are trying to tell others what u feel ?
Better find something else to do.
NOBODY needs an idiots advice and keep them to yourself. You are only
spreading your contagious disease ( idioticism ).
Do something useful rather than try to PROVE that u are an idiot of the
highest category.
Hmmmmmmmmmm. Feeling sad that such idiots like you dont get exterminated.
Just asking you out of curiousity, werent u dodos termed "extinct" ? I thought
that u were. Gotta ask my prof. again. He's interested in collecting
specimens like u grauss.
I've been noticing quite a huge number of stupid posts from you trying
to prove a stupid point rather than doing something constructive. Wont u
ever stop that nonsense ?
Hope this mail brings you back to your senses and get rid of your stupid
thoughts from your mind asap. Thats good for all of us.
Oh yeah. i posted it under an anonymous name bcoz i dont want myself to
be seen as someone trying to put sense into a fool and i shouldnt even be
trying to do that. Makes me sick infact to write this to a GROSS MISTAKE like
you and hope its the last.
|
|
|
|
|
Anonymous pussy wrote:
IF you THINK that you are the only guy who knows programming, think deeply
again. Who the hell do u think u are trying to tell others what u feel ?
Better find something else to do.
Thank you for this opportunity to listen to the opinions of a brain dead moron, who does not have the guts to put his name to his words. Let's examine the evidence shall we ?
1. You are a worthless pile of dog manure.
2. I never said I was the only person who knows how to program, where the hell do you get that from ?
3. You are a fetid steaming heap of donkey droppings.
4. What I said is that most people do not know how to program. Catch a bus, take a poll and you'll find it is true.
5. You are a pathetic lump of sparrow vomit.
6. When people post articles, other people find them useful, and people like you comwe along, claiming they are of no worth and do not work, only a fool would presume that anyone other than the person incapable of using the code provided is the problem
7. You are an ugly vomit stain on the fabric of society.
Anonymous pussy wrote:
NOBODY needs an idiots advice and keep them to yourself. You are only
spreading your contagious disease ( idioticism ).
I guess if this is the best you can do to string a sen
tence together, then it's no wonder you'r embarrased to put your name to it.
Anonymous pussy wrote:
Do something useful rather than try to PROVE that u are an idiot of the
highest category
Oh, I see. You mean like 28 articles, and countless posts helping people in the forums ? Get stuffed. Sometimes helping people does not mean saying what they want to hear. Deal with it.
Anonymous pussy wrote:
Hmmmmmmmmmm. Feeling sad that such idiots like you dont get exterminated.
Just asking you out of curiousity, werent u dodos termed "extinct" ? I thought
that u were. Gotta ask my prof. again. He's interested in collecting
specimens like u grauss.
The guy in the white coat is not a professor and your lab jacket isn't fitting badly, it's *supposed* to restrain you.
Anonymous pussy wrote:
I've been noticing quite a huge number of stupid posts from you trying
to prove a stupid point rather than doing something constructive. Wont u
ever stop that nonsense ?
In that case, if you're such a regular here, why do you not have a name ? Because you're a pussy, that's why. What makes you think I could care less of the opinions of someone who thinks the way to respond to an intelligent comment is to talk about extermination, idiots and so on, but to not have the courage to put a name to thier comments ? You are below contempt. I hate you. I really do. People like you are lowering the signal to noise ratio of this site, and the only good thing about you is that I am reminded that there are still idiots in this world, who once they fail their degree will need to employ people like me to write code for them.
Now get stuffed. Or tell us who you are, if you're not a worthless lump of jelly. It's easy to attack people anonymously. I'd much prefer to meet you face to face, so you can try to 'exterminate' me, and I can beat the crap out of you.
I'm waiting.....
Anonymous pussy wrote:
Hope this mail brings you back to your senses and get rid of your stupid
thoughts from your mind asap. Thats good for all of us.
I hope you crawl back under your rock, and consider what a gutless wimp you are.
Anonymous whiney pussy wrote:
Oh yeah. i posted it under an anonymous name bcoz i dont want myself to
be seen as someone trying to put sense into a fool and i shouldnt even be
trying to do that.
I see, you ARE stupid then. How do you remember to breathe ? You HAVE 'tried to talk sense to me', ( a.k.a. insulted me, and that badly ), you just don't have the guts to put your name to the attempt. Get over yourself.
Anonymous whiney worthless pussy wrote:
Makes me sick infact to write this to a GROSS MISTAKE like
you and hope its the last.
Like I said. Get in the ring, or go home and cry to momma.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
hi GROSS idiot,
The GROSS IDIOT got what he deserved for poking his nose in things that
doesnt concern him.
Sparrow vomit??Never heard of that. Oh, u musta been eatin that everyday
bcoz thats how u know abt that. dont ya ? Just saw your photo on ur profile
and u sure look like a man who eats sparrow vomit.
U look so UGLY, FAT AND DUMB. I betcha ur mom woulda screwd some roadside
beggar and the result is YOU. aint u ? Or, Maybe that beggar's condom had a
hole in it. Eh ?
CHRISTIAN GRAUSS - THE SPARROW VOMIT EATER
THE SONOFABEGGAR
THE NOSE POKER ( PICKER is also a valid choice )
THE UGLIEST SPECIMEN ON EARTH
I dont care abt what u say sh*tty bas***d, but any time i see u post
nonsense again, i'm gonna screw u like this f***_er. Go on and call me
names too. i dont care . its not my name thats getting spoilt. mind ya.
I AM IN MORRISON STREET, HOBART TOO AND I'VE SEEN U LOTS OF TIMES
LOITERING AROUND WITH THAT OTHER UGLY BIT*CH U CALL UR GIRLFRIEND. I KNOW HOW
TO GET U IDIOT, BUT U DONT. WATCH OUT....... I'll get u sooner than u
expect.i'd like to tell ya that i've a black belt in karate too.
CHRISTIAN GRAUSS - THE DODO
Definition of a dodo : an ugly looking thing that eats sh*t and has no brains
bcoz its brains are full of sh*t too. warning : keep as far away from the
dodo as possible as it STINKS.
|
|
|
|
|
worthless anonymous clown wrote:
The GROSS IDIOT got what he deserved for poking his nose in things that
doesnt concern him.
What doesn't concern me ? That you're too stupid to understand what I said in the first place, too gutless to post your name, or too pathetic to post anything intelligent ?
Anonymous wrote:
I AM IN MORRISON STREET, HOBART TOO AND I'VE SEEN U LOTS OF TIMES
LOITERING AROUND WITH THAT OTHER UGLY BIT*CH U CALL UR GIRLFRIEND. I KNOW HOW
TO GET U IDIOT, BUT U DONT. WATCH OUT....... I'll get u sooner than u
expect.i'd like to tell ya that i've a black belt in karate too.
I presume you got morrison st from www.dytech.com.au, because my *wife* has never met me at work, nor do I ever hang around outside, nor would you have any way of recognising me if I did. Nice try, bozo.
Anonymous wrote:
but any time i see u post
nonsense again, i'm gonna screw u like this f***_er.
I must admit that had I not had a really bad day, I would not have bothered with a worthless clown like you. So I'm starting now. So I've got another anonymous moron down-voting my articles and making empty threats. Boo hoo. You're the one with no guts, no brains and no life. I'm truly sorry I sank to your pathetic level, but it smells down here, so I'll leave now.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Are either of you proud of your postings? Just wondering...
|
|
|
|
|
Dunno that I'd say proud, but not ashamed. It was pretty funny at the time.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
You idiot if dont know anything dont submit such idiotic article and waste our time. You better learn VC++ well and try to give something good for all. Dont do such idiotic works wasting ur and our time.
|
|
|
|
|
Hi,
Thanks a lot for your comment. Since its hurting you and wasting your precious time, please refrain yourself from reading my articles. But if i am not mistaken, I didnt ask you to specifically go through these. Did i ?
If i wasted your time, i'm sorry about that but sometimes,an idiotic comment can help someone at some point of time. Thats what i think.
** Anyway, thanks for your comment again. It makes me feel really happy to know that i'm not the only person who is idiotic. **
p.s. Posting a comment using the anonymous login can be an advantage for you because you dont want to expose yourself. Great courage. Keep it up.
With warm regards,
V.Girish
|
|
|
|
|
Hi,
I forgot to tell you something. Even bill gates was thought to be a dullard. But it wasnt.
Anyway, i dont care for such comments as yours pal.
I know that there are jealous people, stupid people, people who waste their time and others time by starting something idiotic, people who dont know what they are talking, people who cant do anything but keep commenting on others and people who arent fit for anything but think they are.
I'm not saying that you are in all those categories, but.....
With warm regards,
V.Girish
|
|
|
|
|
Oh my god...Is this Codeproject or what?...Whatz going on here man..Chris please do something to stop all these nonsenses
Sundar
|
|
|
|
|
I think auther of this article should browse throgh codeProject articles before he submits one on the same topic. I feels lots of articles covers this topic nicely. I don't think anything new on this article!!
So why you reinvent a weel?
|
|
|
|
|
Have you never heard the expression, "if you can't find anything good to say, don't say anthing at all"?
This article gives a succinct description of what double buffering is, and how to accomplish it using MFC. Though this may be old-hat for you and i, to a suprisingly large number of people it is unknown. AFAIK, the author did not plagiarize the article, so why rip on him for posting it? Some tutorials appeal to one person, others to another. If you really need to criticize the author for something, the article should have been formatted according to CP standard conventions, but even then there have been far, far worse violations in the past (IMHO).
--------
Have you hugged your monitor today? --Shog9 --
|
|
|
|
|
I agree with the first guy - this topic IS covered on CP, and covered better than this.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
I am one of those who has benefitted from this article. I had just such a flickering problem the article described, which after reading it, I applied the solution it offered and the flickering stopped!!
I am happy and thankful to the author for having submitted such an article, and AFAIC, it has fulfilled both in spirit and work, the culture of CodeProject, which is to help others.
William
|
|
|
|
|
The issue is not if it is helpful, it is that it is information that is here already.
http://www.codeproject.com/useritems/flicker_free_intro.asp
http://www.codeproject.com/gdi/flickerfree.asp
I do not want to discourage ANYONE from contributing to CP, yet if we find ourselves swamped with articles repeating the same information, the site just becomes cluttered, and when people are browsing a category and see three articles on the same thing, the impression is of a site which is not all that organised. This is a brilliant site, personally I don't like the unedited article facility precisely because it allows articles like this one, which are badly formatted and offer nothing new to the site.
To the author: I am suggesting you try harder to format your articles nicely and to ensure you're not doubling up. I've put a lot more work than you have here into articles and removed them when I found they covered things already done elsewhere. I am NOt trying to discourage you from contributing.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
|
|
|
|
|