PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: CGpBrush Class  (Read 195 times)

raymw

  • Senior Member
  • ***
  • Posts: 363
CGpBrush Class
« on: October 04, 2019, 11:39:31 AM »

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.)

« Last Edit: October 04, 2019, 11:41:10 AM by raymw »
Logged

Josť Roca

  • Guru Member
  • *****
  • Posts: 3217
Re: CGpBrush Class
« Reply #1 on: October 04, 2019, 11:55:51 AM »

raymw

  • Senior Member
  • ***
  • Posts: 363
Re: CGpBrush Class
« Reply #2 on: October 04, 2019, 01:52:08 PM »

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.
Logged