Professional UI Solutions
Site Map   /  Register


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 » How to set background image on Dialog? Collapse All
Subject Author Date
Anil Siddhpura Aug 11, 2009 - 1:08 AM


How can I set an Image(Bitmap Image) as the background of a dialog?

I tried with Picture Control, but with this other controls on dialog goes behind the Image.  I also write a function to set background image, but it works only with CDialog. As i inherit my dialog class from CExtResizableDlg, it does not working.

So, is there any other method to set background image when dialog class is inherit from CExtResizableDig?

Technical Support Aug 24, 2009 - 11:25 AM

How do you paint your bitmap image? If you are using the CExtBitmap class, please switch to the CExtBitmapCache class. Do not load bitmap from resources each time when it should be painted. Add some CExtBitmapCache property into your dialog class and load your bitmap only once when the dialog is initialized.

Anil Siddhpura Aug 25, 2009 - 3:07 AM


No i am not loading bitmap image from resource each time, i am loading it only for once.

Also, as you told i switched to CExtBitMapCache, but there is no difference. I am still facing the problem.

For painting image i am using ::Draw() function.

Technical Support Aug 26, 2009 - 5:12 AM

Please try to compare your application with the TabbedBars sample. This sample application also draws bitmap based backgrounds inside resizable bars.

Technical Support Aug 22, 2009 - 11:42 AM

The image painting is a quite fast operation. Did you try to create a version of your dockable dialog without background image painting? Is it really faster?

Anil Siddhpura Aug 23, 2009 - 11:59 PM


Yes, i tried it without background image and it is quite faster. But when i implement it for background image, the docking of dialog become too slow because of that background image painting.


Technical Support Aug 11, 2009 - 5:45 AM

The feature you are looking for is demonstrated in the TabbedBars sample. The view window is a One Note tab page container with 3 colored tabs. The last tab page is the dialog which allows you to configure the inherited background painting in scope of main frame window and one note tab page container window. We discussed this in these threads:

Anil Siddhpura Aug 21, 2009 - 11:28 PM


Thanks for the reply. Now, I am able to draw background image on dialog. I have implemented same as in "Replacebackground" sample.

But now i am facing another problem. I have implemented this on a dockable bar dialog. Whenever the dockable bar comes out, it’s too much slow because of that background image drawing. Anything we can do, so it’s not become slow?