|
Right now I am creating a compatible DC and drawing directly into it using LineTo() and MoveTo()
Then I BitBlt it into the actual CDC
But for a few nasty nano-seconds I can see the original background
Is there any way to speed up things? There is a pretty heavy loop with some maths calculations and stuff.
Would it be faster to directly draw onto the CDC?
Regards
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Buy it, read it and admire me
|
|
|
|
|
You need to draw in OnEraseDC, then you won't see it.
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
|
|
|
|
|
|
|
First of all where is CG?
he made me waste 15 minutes searching MSDN/Google etc. for a non-existant message and message handler
OnEraseDC() my right foot!!!!!!!!!!!!
okay, now that, that's over, this is what I did
I added a CBitmap member and I draw my stuff onto this bitmap.
Thus during OnEraseBkgnd I simply use BitBlt to put this bitmap onto our CDC
Nice eh?
Donno if there are any hidden loopholes
I am just beginning this stuff, you see.
My GDI awareness is just two days old - started this week
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Buy it, read it and admire me
|
|
|
|
|
Sorry - I am watching 'The Others' and just came by and saw the question. OnEraseBkgnd is right. My GDI is rusty too.
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
|
|
|
|
|
Christian Graus wrote:
Sorry - I am watching 'The Others' and just came by and saw the question
Now fancy that! The nice man was watching "The Others" and just came by and seeing the question thought it'd be really nice to lead the guy onto a wild goose chase looking for a non-existant function!
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Buy it, read it and admire me
|
|
|
|
|
MSDN should have a good example under the bitblt definition.
Like it or not, I'm right.
|
|
|
|
|
|
CPaintDC dc(this);
CRect rect;
GetClientRect(&rect);
CDC dc2;
dc2.CreateCompatibleDC(&dc);
dc2.FillSolidRect(0,0,100,100,RGB(0,0,127));
dc.BitBlt(0,0,rect.Width(),rect.Height(),&dc2,0,0,SRCCOPY);
CDialog::OnPaint();
Nothing happens
Why is the BitBlt failing?
If I comment out the BitBlt line and call FillSolidRect directly on dc it works
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Buy it, read it and admire me
|
|
|
|
|
|
|
Let's see some code...
How do you do it?
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Anders Molin wrote:
Let's see some code...
How do you do it?
CPaintDC dc(this);
CDC dc2;
dc.CreateCompatibleDC(&dc2);
This is inside CDialog::OnPaint()
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Buy it, read it and admire me
|
|
|
|
|
|
Woops, I didn't see either.
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Let All the Windows' Title Set by My Presetting String when they Created.
In simple words, I want to make all windows display the same title.
Some may say that it can be done by enumwindow() and setwindowtext(), but how can I know when a new window is created and I set the title in time?
Are there any other method existing ???
Who can do it?
|
|
|
|
|
Why ask the same question again, you've had the answer.
The real question is, why would you want to do something so stupid ?
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
|
|
|
|
|
Christian Graus wrote:
The real question is, why would you want to do something so stupid ?
I think there is this new trend of making high performance annoyance applications. They have a big market nowadays
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Buy it, read it and admire me
|
|
|
|
|
I am very intrested in UI programming ,so I am just to
try something intresting ....
|
|
|
|
|
The system does not support it beyond the ways we have suggested because it is a dumb thing to do. Why not try to learn how to do something useful ?
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
|
|
|
|
|
Christian Graus wrote:
why would you want to do something so stupid ?
Amazing to see that people are full of ideas like this. ![Smile | :)](https://codeproject.global.ssl.fastly.net/script/Forums/Images/smiley_smile.gif)
|
|
|
|
|
Call SetWindowsHookEx() and set a CBT hook. You'll get notified as each window is created.
--Mike--
Just released - RightClick-Encrypt - Adds fast & easy file encryption to Explorer
Like the Google toolbar? Then check out UltraBar, with more features & customizable search engines!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Hi.
I started out using a CListBox in a dialog box. However, I wanted to add a grid feature, so I posted a message about how to add a grid to it. I found out the only way is to use a CListCtrl. I implemented a CListCtrl in place of the CListBox. There is one problem. I cannot get it to return a selected item or the selected items. There are no getseltime or getselitemindex.
How do you determine what item a user selects in a CListCtrl?
Thanks,
Kuphryn
|
|
|
|
|
Look up CListCtrl::GetFirstSelectedItemPosition() and CListCtrl::GetNextSelectedItem().
--Mike--
Just released - RightClick-Encrypt - Adds fast & easy file encryption to Explorer
Like the Google toolbar? Then check out UltraBar, with more features & customizable search engines!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|