GRA_ transparent background

This forum is for eXpress++ general support.
Message
Author
bwolfsohn
Posts: 649
Joined: Thu Jan 28, 2010 7:07 am
Location: Alachua, Florida USA
Contact:

GRA_ transparent background

#1 Post by bwolfsohn »

@ nRow, 40 DCPRINT SAY cCopyWord ALIGN DCPRINT_ALIGN_HCENTER FONT "60.Arial Bold" COLOR

i can use an array to change the foreground color, but how do i make the background transparent.. right now, i am always getting a box..

Brian
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

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: GRA_ transparent background

#2 Post by rdonnay »

Something seems to be missing in your sample. Please give me something I can compile and run.
The eXpress train is coming - and it has more cars.

bwolfsohn
Posts: 649
Joined: Thu Jan 28, 2010 7:07 am
Location: Alachua, Florida USA
Contact:

Re: GRA_ transparent background

#3 Post by bwolfsohn »

Roger,

i'm just looking for a generic answer to how i can print with transparent background

@ 1, 40 DCPRINT SAY "Office" ALIGN DCPRINT_ALIGN_HCENTER FONT "60.Arial Bold" COLOR {180,180,180}
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

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: GRA_ transparent background

#4 Post by rdonnay »

I just tried this and it works for me:

Code: Select all

@ 3, 40 DCPRINT SAY "Office" ALIGN DCPRINT_ALIGN_HCENTER FONT "60.Arial Bold" COLOR {180,180,180}, GRA_CLR_WHITE
The eXpress train is coming - and it has more cars.

bwolfsohn
Posts: 649
Joined: Thu Jan 28, 2010 7:07 am
Location: Alachua, Florida USA
Contact:

Re: GRA_ transparent background

#5 Post by bwolfsohn »

oook.. i see where my problem / question is not clear..

here is an invoice.. look at the second page

i'll send the file via email.. it's not allowing me to upload a pdf.
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

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: GRA_ transparent background

#6 Post by rdonnay »

I don't understand why there is a white background around the word "Office". It's much larger than the foreground letters. Are you sure you aren't painting that with @ dcprint box ?
The eXpress train is coming - and it has more cars.

bwolfsohn
Posts: 649
Joined: Thu Jan 28, 2010 7:07 am
Location: Alachua, Florida USA
Contact:

Re: GRA_ transparent background

#7 Post by bwolfsohn »

i'm sure... the graybar is being printed before the word, and the word background is overwriting the graybar.

the code i gave you is exactly what is being printed..

nRow:=nSTARTROW+5
FOR i := 1 TO 3
@ nRow, 40 DCPRINT SAY cCopyWord ALIGN DCPRINT_ALIGN_HCENTER FONT "60.Arial Bold" COLOR {nGrayVal,nGrayVal,nGrayVal}
nRow+=15
NEXT
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

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: GRA_ transparent background

#8 Post by rdonnay »

Did you try this?

COLOR {nGrayVal,nGrayVal,nGrayVal}, GRA_CLR_WHITE

or this ?

COLOR {nGrayVal,nGrayVal,nGrayVal}, XBPSYSCLR_TRANSPARENT

I'm going to try some more testing.
The eXpress train is coming - and it has more cars.

bwolfsohn
Posts: 649
Joined: Thu Jan 28, 2010 7:07 am
Location: Alachua, Florida USA
Contact:

Re: GRA_ transparent background

#9 Post by bwolfsohn »

transparent paints a black background..

white paints a white background..
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

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: GRA_ transparent background

#10 Post by rdonnay »

I figured it out.

I made the following change to _DCPRES.PRG:

Code: Select all

FUNCTION DC_Color2Attr( anColorFG, anColorBG, nWhich )

LOCAL aAttr

DEFAULT nWhich := GRA_AS_COUNT

IF Valtype(anColorFG) == 'B'
  anColorFG := Eval(anColorFG)
ENDIF

IF Valtype(anColorFG) == 'A' .AND. Len(anColorFG) == 3
  anColorFG := GraMakeRGBColor(anColorFG)
ENDIF

IF Valtype(anColorBG) == 'A' .AND. Len(anColorBG) == 3
  anColorBG := GraMakeRGBColor(anColorBG)
ENDIF

aAttr := Array(nWhich)

IF nWhich == GRA_AS_COUNT  // text
  IF Valtype(anColorFG) == 'N'
    aAttr[GRA_AS_COLOR] := anColorFG
  ENDIF
  IF Valtype(anColorBG) == 'N'
    aAttr[GRA_AS_BACKCOLOR] := anColorBG
  ENDIF
  // aAttr[GRA_AS_BGMIXMODE] := GRA_BGMIX_OVERPAINT  <<<<<<<<<<<<<<<< comment out this line
ELSEIF nWhich == GRA_AA_COUNT // area
  IF Valtype(anColorFG) == 'N'
    aAttr[GRA_AA_COLOR] := anColorFG
  ENDIF
  IF Valtype(anColorBG) == 'N'
    aAttr[GRA_AA_BACKCOLOR] := anColorBG
  ENDIF
  aAttr[GRA_AA_BGMIXMODE] := GRA_BGMIX_OVERPAINT
ELSEIF nWhich == GRA_AM_COUNT // marker
  IF Valtype(anColorFG) == 'N'
    aAttr[GRA_AM_COLOR] := anColorFG
  ENDIF
  IF Valtype(anColorBG) == 'N'
    aAttr[GRA_AM_BACKCOLOR] := anColorBG
  ENDIF
  aAttr[GRA_AM_BGMIXMODE] := GRA_BGMIX_OVERPAINT
ELSEIF nWhich == GRA_AL_COUNT // line
  IF Valtype(anColorFG) == 'N'
    aAttr[GRA_AL_COLOR] := anColorFG
  ENDIF
//  aAttr[GRA_AL_MIXMODE] := GRA_MIX_OVERPAINT
ENDIF

RETURN aAttr
This will be in build 258. For now you can make this change in your _DCPRES.PRG and then rebuild DCLIPX.DLL by running BUILD19_SL1.BAT.

Or Look at my next posting for a better solution.
The eXpress train is coming - and it has more cars.

Post Reply