bitmap resource
bitmap resource
Roger,
Way back in the last century, we (you & i) included this code in our main system menu..
DCGETOPTIONS WINDOWWIDTH nWidth ;
WINDOWHEIGHT nHeight ;
WINDOWROW nStartRow ;
WINDOWCOL nStartCol ;
AUTOWINDOWMENU ;
BITMAP IIF( STA_COOLSCRN,CUS_BITMAP_LOGO_BACKGROUND,nil ) ;
COLOR {160,160,160} ;
TOOLTIPCOLOR GRA_CLR_BLACK, GRA_CLR_YELLOW ;
ABORTQUERY MSG {||isbyebye()} ;
CLOSEQUERY MSG {||isbyebye()} ;
EVAL {|o|oTimer:=DC_SetTimerEvent():new(100,{||_UpdateStats(GetList)},SetAppWindow(o)) } ;
HELPCODE 'DESKTOP.AUCTION'
the bitmap was compiled into a .res file via an .arc file.
questions:
1. Is this still the most efficient way to do this ?
2. is there a newer alternative for a main window background ?
3. Is it possible to change the bitmap during program execution ?
thanks..
Way back in the last century, we (you & i) included this code in our main system menu..
DCGETOPTIONS WINDOWWIDTH nWidth ;
WINDOWHEIGHT nHeight ;
WINDOWROW nStartRow ;
WINDOWCOL nStartCol ;
AUTOWINDOWMENU ;
BITMAP IIF( STA_COOLSCRN,CUS_BITMAP_LOGO_BACKGROUND,nil ) ;
COLOR {160,160,160} ;
TOOLTIPCOLOR GRA_CLR_BLACK, GRA_CLR_YELLOW ;
ABORTQUERY MSG {||isbyebye()} ;
CLOSEQUERY MSG {||isbyebye()} ;
EVAL {|o|oTimer:=DC_SetTimerEvent():new(100,{||_UpdateStats(GetList)},SetAppWindow(o)) } ;
HELPCODE 'DESKTOP.AUCTION'
the bitmap was compiled into a .res file via an .arc file.
questions:
1. Is this still the most efficient way to do this ?
2. is there a newer alternative for a main window background ?
3. Is it possible to change the bitmap during program execution ?
thanks..
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Re: bitmap resource
Hi, Brian.
I removed the "BITMAP" clause from my main menu options and added this code right behind "DCGET OPTIONS":
I removed the "BITMAP" clause from my main menu options and added this code right behind "DCGET OPTIONS":
Code: Select all
IF !Empty(cMyMainMenuBitmap) .and. File(cMyMainMenuBitmap) // "cMyMainMenuBitmap" may be something like "c:\images\pict999.jpg"
GetOptions[nGETOPT_BITMAP] := DC_GetBitmap(cMyMainMenuBitmap)
ELSE
GetOptions[nGETOPT_BITMAP] := BITMAP_FROM_RESSOURCE
ENDIF
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Re: bitmap resource
Tom,
thanks, i think i'll try that...
But, can GetOptions[nGETOPT_BITMAP] be changed during the program and will it redisplay ?
If not, are there other approaches ?
thanks, i think i'll try that...
But, can GetOptions[nGETOPT_BITMAP] be changed during the program and will it redisplay ?
If not, are there other approaches ?
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Re: bitmap resource
Here is how Bobby Drakos changes the background in his Medalion program during the day.
He has a timer that loads a different bitmap to show the color of the sky at different times of the day.
He has a timer that loads a different bitmap to show the color of the sky at different times of the day.
Code: Select all
oDlg:drawingArea:bitmap := DC_GetBitmap(cBitmap)
oDlg:lockUpdate(.T.)
oDlg:configure()
oDlg:LockUpdate(.F.)
The eXpress train is coming - and it has more cars.
Re: bitmap resource
thanks.. perfect.. that's what i'm looking for...
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
Re: bitmap resource
Is it possible to bring something like a small working demo program with source code as xdemo.exe? I got interested in these opportunities.rdonnay wrote:Here is how Bobby Drakos changes the background in his Medalion program during the day.
He has a timer that loads a different bitmap to show the color of the sky at different times of the day.
Code: Select all
oDlg:drawingArea:bitmap := DC_GetBitmap(cBitmap) oDlg:lockUpdate(.T.) oDlg:configure() oDlg:LockUpdate(.F.)
Re: bitmap resource
Here it is (attached)Is it possible to bring something like a small working demo program with source code as xdemo.exe? I got interested in these opportunities.
Code: Select all
#INCLUDE "dcdialog.CH"
LOCAL GetList[0], GetOptions, oTimer, oDlg, aBitmaps
aBitmaps := Directory('mwb1024*.bmp')
DCGETOPTIONS ;
WINDOWWIDTH 1024 ;
WINDOWHEIGHT 800
oTimer := DC_SetTimerEvent():new(200,{||ChangeBackground(@oDlg,aBitmaps)})
DCREAD GUI TITLE 'Rotating Bitmap Backgrounds' PARENT @oDlg ;
OPTIONS GetOptions
oTimer:destroy()
RETURN nil
* -----------
PROC appsys ; RETURN
* -----------
STATIC FUNCTION ChangeBackground( oDlg, aBitmaps )
LOCAL oBitmap
STATIC snPointer := 0
snPointer++
IF oDlg == nil .OR. oDlg:status() = 0 .OR. Len(aBitmaps) = 0
RETURN nil
ENDIF
IF snPointer > Len(aBitmaps)
snPointer := 1
ENDIF
oBitmap := DC_GetBitmap(aBitmaps[snPointer,1])
oDlg:lockUpdate(.t.)
oDlg:drawingArea:bitmap := oBitmap
oDlg:configure()
oDlg:lockUpdate(.f.)
RETURN nil
- Attachments
-
- background.zip
- (1.79 MiB) Downloaded 656 times
The eXpress train is coming - and it has more cars.
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
Re: bitmap resource
Very nicely done. Just a HUGE thank you! Be sure I will enjoy!
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
Re: bitmap resource
oTimer := DC_SetTimerEvent():new(200,{||ChangeBackground(@oDlgBmp,aBitmaps,"ЧЧ")})
Can I do to change the image is not initiated after a while, and on a specific event, such as when there is a change hours
Yet for some reason when you change the image disappears open window mode, and the menu is still displayed normal.
How to make the background appear just outside the window, and not painted all over it?
How to make the main window always remained in the background and does not overlap the new window when it is updated background?
Can I do to change the image is not initiated after a while, and on a specific event, such as when there is a change hours
Yet for some reason when you change the image disappears open window mode, and the menu is still displayed normal.
How to make the background appear just outside the window, and not painted all over it?
How to make the main window always remained in the background and does not overlap the new window when it is updated background?
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
Re: bitmap resource
Can I do to change the image is not initiated after a while, and on a specific event, such as when there is a change hours
Yet for some reason when you change the image disappears open window mode, and the menu is still displayed normal.
How to make the background appear just outside the window, and not painted all over it?
How to make the main window always remained in the background and does not overlap the new window when it is updated background?
Yet for some reason when you change the image disappears open window mode, and the menu is still displayed normal.
How to make the background appear just outside the window, and not painted all over it?
How to make the main window always remained in the background and does not overlap the new window when it is updated background?