Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » CExtScrollWnd and DirectX Collapse All
Subject Author Date
pascal bosquet Dec 17, 2004 - 12:01 AM

I’m trying to use CExScrollWnd with DirectDraw. So, CExScrollWnd take care of the computation of the scrollbars. As my application is really graphic intensive, i’d like to paint myself the contents of my CExtScrollWnd using DirectDraw.
So far, i thought that only by painting all in the OnSwPaint( CDC & dc ) will do the job. But i always got a white screen. I can notice that directdraw is drawing well but it’s immediatly erased by the component. I tried to use the different properties like
m_bEatErasing=true; but nothing works, the compoment erase. I overloaded the WM_PAINT, or ERASEBKG but its seems the window is always invalidate by the component. Any clue to do the job ??

this code should erase my CExtScrollWnd in rgb(255,0,255)
void CBankView::OnSwPaint( CDC & dc )
{
    HWND h=this->GetSafeHwnd();
    m_DDSurface->SetClipper((HWND)(h));    
    m_DDSurface->Clear(255,0,255);
    m_DDSurface->Draw(NULL,NULL);
}

thanks in advance

Technical Support Dec 18, 2004 - 5:09 AM

Dear Pascal,

Thank you for the interesting question. First of all, we are not sure whether the Direct Draw painting API is compatible with any kind of scrollable window. So, it would be interesting for us to clarify this issue. Could you send us your test project?

It seems we have already experienced a similar problem. The AviFrames application uses CExtScrollWnd as its main view class that shows video extracted from an AVI stream. This sample creates one child window inside the CExtScrollWnd-based window. This window displays video frames. So, the scrolling effect of the CExtScrollWnd-based window is based on the moving and resizing of its child window. When designing the sample, we tried to draw video frames directly in the CExtScrollWnd-based window. But the DrawDibDraw() API (we guess it is based on the Direct Draw API) does not draw valid video frames if the scrolling positions are not set to zero.

pascal bosquet Dec 17, 2004 - 9:01 PM

another thing, my display in the CExtScrollWnd has to be rendered each time. Coz my bitmap can be virtually unlimited. Is it possible to use CExtScrollWnd in such behavior ? coz it seems that CExtScrollWnd scroll itselft the bitmap but the bitmap has to be fixed and stand in memory

Technical Support Dec 20, 2004 - 2:25 AM

The CExtScrollWnd class ("as is") does not scroll the data in an unlimited range. It works with Win32 scrolling API that allows you to specify scrolling parameters as 32-bit numeric values. The CExtScrollItemWnd class (available but unused in Prof-UIS Freeware) extends the features of CExtScrollWnd with the scrolling strategies. The pixel-by-pixel and item-by-item scrolling strategies operate with limited ranges of the scrollable content. But the virtual scrolling strategy is designed to work with unlimited data ranges and with a scrollable content that cannot have an explicitly determined beginning, end, and even the current scrolling position. The virtual scrolling strategy is often used in database grid controls that fetch data rows dynamically and cannot determine the exact scrolling position in a dynamically updated data table. The thumb button in the virtual scroll bar can take only three positions: at the beginning, at the end, and exactly in the middle. When the data provider cannot detect whether the first and last rows are visible in the grid control then the thumb button is always located in the middle position on the scrollbar. Is this that you need in your application?