Originally posted by: cfish
How to Draw a PNG format image on my form without flash???
ReplyOriginally posted by: Haim
Hi,
I've implemented the CMemDC in my derived CFormView class. I have no special drawing to do so in the OnDraw implementation I called CFormView::OnDraw(pDC).
The screen continue to flicker and the background become white (instead of gray).
What should I do if I have NO special drawing in my derived CFormView class?
ReplyOriginally posted by: Adriano
I have serious problems with flickering in my Dialog based application. Simply I must draw (every 100 ms about) some rectangles, so I wrote the code to paint these rectangles in the OnPaint method (member of my sub-class Cdialog type). How I can resolve my problem?
Thank you very much.
Adriano
ReplyOriginally posted by: Joe
This code works very well.
ReplyOriginally posted by: Ooms Gauthier
When you pass a DC using pCDC = pWnd->GetDC(); to the CMemDC constructor there will be a memory leak, because the pCDC wont be released (pWnd->ReleaseDC(pCMemDC); wont release the pCDC). So what i've done to fix this is the following:
CClientDC pCCDC(pWnd);
CDC* pCDC = &pCCDC
and then passing this pCDC with the CMemDC constructor. CClientDC gets released automatically.
Hope that helps some people, took me a while to find this one.
Reply
Originally posted by: vilas
My question is
suppose i have 5 to 6 bitmap on the view when i resize the window
i dont want to redraw all the bitmaps.
is there any method for this
Originally posted by: _sailinsky
If i wanna pass a CPaintDC variable to the construtor of the CMemDC,there'll incur a problem in the line pDC->GetClipBox.If you use CMemDC in your CYourClass::OnPaint,in this function a CPaintDC variable is constructed,which is generated by MFC Appwizard.You know after call of the constructor,there is no any clip box.So that line of code will get a NULL rectangle.As a result the subsequent code will also work improperly.
ReplyOriginally posted by: calum
i read with interest about reducing the flicker on resizing and dragging - which has been bugging me in my app. but what really bugs me is that i get flicker as the app updates the contents of my grid control. i populate a grid control (msflexgrid) with data from a list of objects (all the same kind). when i get an update to an object, i call updateallviews to get the ondraw function to loop through the list of objects and update the values in the grid. but i think the actual grid itself is being redrawn each time, and not the individual cells. i wouldn;t mind about the flickering during resizing, as i don;t resize it much, but with lots of entries in the grid needing to be changed every couple of seconds, it's going to give me epilepsy or something.
can you help? i suspect it;s the way i use updateallviews to cause the view to update itself.
thanks
calum
Originally posted by: Kyle Katarn
hi there,
Brad Larsen wrote some code to make the CMemDC class faster.
He also wrote, that he creates the bitmap outside the OnDraw function, so it's not created at every draw.
My problem is to create the bitmap outside.
Example:
void CMyView::OnDraw(CDC* pDC)
{
CDC memDC;
CRect rDisplay;
CBitmap bmpBuf;
CNFODoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
GetClientRect(&rDisplay);
memDC.CreateCompatibleDC(pDC);
bmpBuf.CreateCompatibleBitmap(pDC,rDisplay.Width(), risplay.Height()); //here's the problem. The function needs pDC as first parameter, but how can I get acces to it @ Initialize() ??
CBitmap *pOldBitmap = memDC.SelectObject(&bmpBuf);
Thanx in advance
Kyle K.
Reply
Originally posted by: winwolf
How can I get filter free in dialog? I thik it is different with CView, right? and I can not find OnDraw().
Reply