Author | Topic: Color palette of CRT apps | |
---|---|---|
Simo Franz | Color palette of CRT apps on Wed, 31 Jan 2007 16:26:17 +0100 Is it possible to modify all of 16 colours of CRT application, using RGB value ? many thanks. | |
James Loughner | Re: Color palette of CRT apps on Wed, 31 Jan 2007 12:45:37 -0500 I don't think so at least for pure CRT. Hybrid I believe you can use gramakeRGBcolor() to change the colors. Jim Simo Franz wrote: > Is it possible to modify all of 16 colours of CRT application, using RGB > value ? > > many thanks. > > | |
Simo Franz | Re: Color palette of CRT apps on Fri, 02 Feb 2007 17:51:14 +0100 My app is written in hybrid mode, not in pure CRT window. May i use some API's to change the colour value of the main window ? "James Loughner" <jwrl@charter.net> ha scritto nel messaggio news:7e1a0f57$564bb82e$7b299@news.alaska-software.com... >I don't think so at least for pure CRT. Hybrid I believe you can use > gramakeRGBcolor() to change the colors. > > Jim > > > Simo Franz wrote: >> Is it possible to modify all of 16 colours of CRT application, using RGB >> value ? >> >> many thanks. >> >> | |
AUGE_OHR | Re: Color palette of CRT apps on Fri, 02 Feb 2007 20:06:40 +0100 hi, > May i use some API's to change the colour value of the main window ? you can change color of "Background" using oCrt:presSpace, but your are not able to SAVESCREEN it. assume "C:\ALASKA\XPPW32\RESOURCE\BITMAP\ABLUE.BMP". sample show 34 Rows 100 Colume Bitmat as "Background" and some GRA_ Colors greetings by OHR Jimmy *** snip *** #include 'common.ch' #include 'font.ch' #include 'gra.ch' #include 'xbp.ch' PROCEDURE APPSYS RETURN PROCEDURE main() LOCAL oCrt, oFont, aOldAttr, aAttStr LOCAL oPS,oLogo,aAttr oCrt := Crt4Test():new():create() oPS := oCrt:presSpace() SetAppWindow(oCrt) SetColor("N*/W") CLS DispBox(10,32,16,46,1,"R+*/W") @ 05,24 SAY "This is a 'normal' XbpCRT Window" COLOR "B+*/W" @ 12,34 SAY "Hello world" COLOR "W+/W" @ 13,34 SAY " very nice " COLOR "N+*/W" @ 14,34 SAY " thank you " COLOR "N*/W" @ MAXROW()-1,34 SAY "MaxCol "+STR(MAXCOL()) @ MAXROW() ,34 SAY "MaxRow "+STR(MAXROW()) INKEY(5) aAttr := Array( GRA_AA_COUNT ) Fllattribut bestimmen * aAttr [ GRA_AA_SYMBOL ] := GRA_SYM_DENSE5 aAttr [ GRA_AA_COLOR ] := GRA_CLR_WHITE aAttr [ GRA_AL_COLOR ] := GraMakeRGBColor({153,203,255}) aAttr [ GRA_AL_MIXMODE ] := GRA_FGMIX_XOR GraSetAttrArea( oPS, aAttr ) GraBox(oPS, {0,0}, oCrt:currentSize(), GRA_FILL) GraStringAt(oPS,{100,200},'do you like GraMakeRGBColor({153,203,255})') INKEY(5) CLS aOldAttr := GraSetColor(oPS, , GRA_CLR_YELLOW, GRA_CLR_BROWN) oLogo := XbpBitmap():new():create() oLogo:loadfile("C:\ALASKA\XPPW32\RESOURCE\BITMAP\ABLUE.BMP") BMP2CRT(oLogo,oCrt:currentSize(),oPS) GraSetColor(oPS, aOldAttr[01], aOldAttr[02]) SetAppFocus(oCrt) DispBox(10,32,16,46,1,"R+/W") @ 12,34 SAY "Hello world" COLOR "W+*/N" @ 13,34 SAY " very nice " COLOR "W+*/R" @ 14,34 SAY " thank you " COLOR "N*/GR+" aAttStr := Array(GRA_AS_COUNT) aAttStr[GRA_AS_COLOR] := GRA_CLR_PINK aAttStr[GRA_AS_MIXMODE] := GRA_FGMIX_OVERPAINT GraSetAttrString(NIL, aAttStr) GraStringAt(oPS, { 40, 4}, 'Fonts and original colors') aAttStr := Array(GRA_AS_COUNT) *aAttStr[GRA_AS_COLOR] := GraMakeRGBColor({ 41, 22, 114}) aAttStr[GRA_AS_COLOR] := GRA_CLR_YELLOW aAttStr[GRA_AS_BACKCOLOR] := GRA_CLR_BACKGROUND aAttStr[GRA_AS_MIXMODE] := GRA_FGMIX_OVERPAINT aAttStr[GRA_AS_BGMIXMODE] := GRA_BGMIX_LEAVEALONE aAttStr[GRA_AS_BOX] := NIL aAttStr[GRA_AS_ANGLE] := {1, 0} aAttStr[GRA_AS_SHEAR] := {0, 1} aAttStr[GRA_AS_DIRECTION] := GRA_CHDIRN_LEFTRIGHT aAttStr[GRA_AS_HORIZALIGN] := GRA_HALIGN_LEFT aAttStr[GRA_AS_VERTALIGN] := GRA_VALIGN_BASE aAttStr[GRA_AS_EXTRA] := 0 aAttStr[GRA_AS_BREAK_EXTRA] := 0 aOldAttr := GraSetAttrString(NIL, aAttStr) GraStringAt(oPS, {250, 4}, 'New message') oFont := XbpFont():new(NIL) oFont:create('6.Arial') GraSetFont(oPS, oFont) GraStringAt(oPS, {500, 4}, 'Font 6.Arial') Inkey(10) oCrt:destroy() RETURN CLASS Crt4Test FROM XbpCrt EXPORTED: VAR cMens READONLY VAR oAppWindow READONLY VAR oHadFocus READONLY METHOD Create METHOD Destroy METHOD Init ENDCLASS METHOD Crt4Test:create() ::XbpCrt:create() ::cMens := ('Font: ' + ::fontName + ',' +; Str(::fontwidth, 3) + ',' +; Str(::fontHeight, 3) +; ', ::maxRow:' + Str(::maxRow, 3) +; ', ::maxCol:' + Str(::maxCol, 3)) ::XbpCrt:presSpace() RETURN Self METHOD Crt4Test:Destroy() SetAppWindow(::oAppWindow) SetAppFocus(::oHadFocus) ::XbpCrt:destroy() ::cMens := NIL ::oAppWindow := NIL ::oHadFocus := NIL RETURN NIL METHOD Crt4Test:Init() ::oAppWindow := SetAppWindow() ::oHadFocus := SetAppFocus() now 34 Row, 100 Colume ::XbpCrt:init(NIL,NIL,{0, 28}, 34, 100, 'Title of the XbpCrt', .T.) * ::XbpCrt:init(AppDesktop(),,{0, 0}, 25, 80, 'XbpCrt', .T.) ::fontName := 'Alaska Crt' ::fontWidth := 8 ::fontHeight := 16 ::border := XBPDLG_NO_BORDER for VISTA RETURN Self STATIC FUNCTION BMP2CRT(oBMP,aXbpSize,oPS) LOCAL oHuge,oTiny oHuge := oBMP //Create a small bitmap to fit in our oPS oTiny := XbpBitmap():New():Create() oTiny:Make(aXbpSize[1], aXbpSize[2]) oTiny:presSpace(oPS) //Copie and resize the huge bitmap to the small bitmap oHuge:Draw(oPS, {0,0,aXbpSize[1],aXbpSize[2]}; ,,,GRA_BLT_BBO_IGNORE) RETURN NIL STATIC FUNCTION CENTERPOS( aSize, aRefSize ) RETURN { Int( (aRefSize[1] - aSize[1]) / 2 ) ; , Int( (aRefSize[2] - aSize[2]) / 2 ) } *** eof *** |