Page 1 of 2

GRA_ transparent background

Posted: Thu Jun 14, 2012 11:22 am
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

Re: GRA_ transparent background

Posted: Thu Jun 14, 2012 11:45 am
by rdonnay
Something seems to be missing in your sample. Please give me something I can compile and run.

Re: GRA_ transparent background

Posted: Thu Jun 14, 2012 12:51 pm
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}

Re: GRA_ transparent background

Posted: Thu Jun 14, 2012 12:59 pm
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

Re: GRA_ transparent background

Posted: Thu Jun 14, 2012 1:17 pm
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.

Re: GRA_ transparent background

Posted: Thu Jun 14, 2012 3:51 pm
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 ?

Re: GRA_ transparent background

Posted: Thu Jun 14, 2012 4:17 pm
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

Re: GRA_ transparent background

Posted: Thu Jun 14, 2012 4:31 pm
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.

Re: GRA_ transparent background

Posted: Thu Jun 14, 2012 4:55 pm
by bwolfsohn
transparent paints a black background..

white paints a white background..

Re: GRA_ transparent background

Posted: Thu Jun 14, 2012 5:01 pm
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.