CGpBrush Class

Started by raymw, October 04, 2019, 12:09:31 PM

Previous topic - Next topic

raymw

is the solid brush opaque?

e.g. I have code like this

pw =24
  dim solidbrush as   CGpSolidBrush = GDIP_ARGB(0, 0, 0, 255)
    DIM blackPen AS CGpPen = CGpPen(GDIP_ARGB(20, 0, 0, 0), pw)
blackpen.setlinecap(linecapround,linecapround,linecapround)
blackpen.setbrush(@solidbrush)

then in the line generating loop, I have
   'gradually darken lines from centre
     blackpen.setcolor(GDIP_ARGB(20+j, 0, 0, 0))

  graphics.DrawLine(@blackPen, x,y,x1,y1)

where the ends of the lines overlap it seems the colour is darker. (more like painting with a transparent paint (e.g. watercolour) as opposed to an opaque colour (e.g. oils))
I guess there may be another value to set, or perhaps the order of the various pen settings/brush settings need changing. (the circular dark gey blobs, and the outlining should not be there if opaque colour.)



raymw

Thanks, Jose, I should have known that... well, i did a few years back.
changing pen colour to  blackpen.setcolor(GDIP_ARGB(255,20+j,20+j,20+j))  does what I was looking for.