Possible to change Background of the Main-Wnd from Child ?

Possible to change Background of the Main-Wnd from Child ?

Postby ukoenig » Mon Apr 07, 2008 8:19 pm

Hello,

I want to change the Background of the Main-Window
from Inside of a Child.
It checked different versions for background-setting.
It don't know, if it is possible.
Inside of the child for the dialog, there is no problem.
I want to make it possible, to do all settings with a preview.

I start a Dialog with folder as a MDI-Child, from a Office2007-Buttonbar.

Image

Regards

Uwe[/img]
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Postby Antonio Linares » Mon Apr 07, 2008 9:57 pm

Uwe,

How are you actually setting the background image of the main window in your code ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Changing Background of Windows and Dialogs

Postby ukoenig » Tue Apr 08, 2008 12:22 pm

Antonio

I changed this part with the option < as picture or tiled >,
because i think, it is better to show window-background and
dialog-background together.

Image

Code: Select all  Expand view

FUNCTION TILED_IMG(oBitmap,cBitmap)
LOCAL nRow := 0, nCol := 0, n

hDC := oBitmap:GETDC()

DEFINE BITMAP oImg1 FILENAME cBITMAP

nBmpWidth := oBmp:nWidth()
nBmpHeight := oBmp:nHeight()

// 200 and 280 = Resource-size
// ---------------------------------------

IF nBmpWidth > 0 .and. nBmpHeight > 0
    DO WHILE nRow < 200
         nCol = 0
         DO WHILE nCol < 280
              PalBmpDraw( hDC, nRow, nCol, oBmp:hBitmap )
              nCol += nBmpWidth
         ENDDO
         nRow += nBmpHeight
    ENDDO
ELSE
    MsgAlert( "Not possible to use Picture " + CRLF + ;
                   cBitmap + CRLF + ;
                   "for TILED-selection !", "ATTENTION" )
ENDIF

RETURN( NIL )

// ------------------------

FUNCTION PICTURE_IMG(oBitmap,cBitmap)

DEFINE IMAGE oImg2 FILENAME cBitmap
PalBmpDraw( oBitmap:GETDC(), 0, 0, oImg2:hBitmap, , 280, 200 )

RETURN( NIL )



Thank you

Regards

Uwe :lol: [/img][/code]
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Postby Antonio Linares » Tue Apr 08, 2008 1:57 pm

Uwe,

Important: Everytime that you call to <oControl>:GETDC(), after that, you have to call <oControl>:ReleaseDC(), or you keep an unreleased hDC, thus consuming GDI resources.

I see from your code that you use a bitmap control on top of the window, to show a bitmap. You can directly use oWnd:GetDC() and paint on top of the window, so there is no need to use a @ ..., ... BITMAP there.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 68 guests