Crash with 23.04 GRADIENTFILL()

Crash with 23.04 GRADIENTFILL()

Postby Jimmy » Sun Jul 23, 2023 1:57 am

hi,

Code: Select all  Expand view
  Error description: Error BASE/1068  Argument error: array access
   Args:
     [   1] = U  
     [   2] = N   2

Stack Calls
===========
   Called from: .\source\function\IMGTXTIO.PRG => GRADIENTFILL( 3132 )
   Called from: .\DUALGRID.PRG => TEXPLORER:DOMYCOMBO( 5930 )
   Called from: .\DUALGRID.PRG => (b)MAIN( 916 )

Image
have made a Copy of "old" Source and it work again
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1585
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Crash with 23.04 GRADIENTFILL()

Postby Jimmy » Sun Jul 23, 2023 3:54 am

hi,

ok got it

old Version (which work this Way )
Code: Select all  Expand view
LOCAL aGrad         := { ;
                    { .5, BFcolor, BGcolor }, ;
                    { .6, BGcolor, BFcolor }, ;
                    { .1, BFcolor, BGcolor }, ;
                    }


must be in new Version
Code: Select all  Expand view
local aGrad := ;
      { ;
         { 0.5,    RGB( 140,  56,   6 ),  RGB( 237, 234, 109 )   }, ;
         { 0.5,    RGB( 237, 234, 109 ),  RGB(  85,  62,  84 )   }  ;
      }

a.) last Element no "Komma"
b.) does "slow down" using 3 Elemets
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1585
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Crash with 23.04 GRADIENTFILL()

Postby Rick Lipkin » Sun Jul 23, 2023 3:07 pm

Jimmy .. Here are some gradient code I use to make make things simple ... Rick

Code: Select all  Expand view

//-------------------
Func GreyButtonGrad()

// 2010 grey button skin

Local bGrad

bGrad := { | lInvert | If( ! lInvert, ;
         { { 1, nRGB( 255, 255, 255 ), nRGB( 207, 207, 207 ) } }, ;
         { { 1/3, nRGB( 255, 253, 222 ), nRGB( 255, 231, 151 ) }, ;
         { 2/3, nRGB( 255, 215,  84 ), nRGB( 255, 233, 162 ) } } ) }

Return( bGrad )

//---------------------------
Func BlueGreenGrad()

Local xGrad4 :=  {{ 1.00,14671839,   7419904 }, { 1.00,7419904,  14671839 }}   // med blue
SetDlgGradient( xGrad4 )

Return(nil)

//---------------------
Func SolidGreenBlue()

*SetDlgGradient( { { 0.01,8421376,8421376 },{ 0.01,8421376,8421376 } })

SetDlgGradient({ { 0.01,9994298,9994298 },{ 0.01,9994298,9994298 } })
Return(nil)


//-------------
Func SolidDarkBlue()

SetDlgGradient( { { 0.50,4720905,4720905 },{ 0.50,4720905,4720905 } })
Return(nil)

//-------------------
Func SolidBlue()

SetDlgGradient( { { 0.01,16711680,16711680 },{ 0.01,16711680,16711680 } })
Return(nil)

//------------------
Func DarkBlueGrad()

*SetDlgGradient( { { 0.87,8388608,11100165 },{ 0.87,11100165,8388608 } } )
*SetDlgGradient( { { 0.01,nRgb(4,53,107),11100165 },{ 0.01,11100165,nRgb(4,53,107) } } )
*SetDlgGradient( { { .50, nRGB( 4, 53, 107 ), nRGB( 4, 53, 107 ) } } )

*SetDlgGradient({ { 1.00,8388608,986895   },{ 1.00,986895,8388608   } })
SetDlgGradient({ { 0.0,8388608,13619151 },{ 0.0,13619151,8388608 } })
Return(nil)


//--------------
Func LightGreenGrad()

SetDlgGradient( { { .50, nRGB(210,235,216), nRGB( 255, 255, 255 ) } } )

Return(nil)

//------------------
Func LightBlueGrad()

SetDlgGradient( { { .50, nRGB( 201, 217, 237 ), nRGB( 231, 242, 255 ) } } )

Return(nil)

//------------------
Func LightGreyGrad()

SetDlgGradient( { { .50, nRGB( 216, 216, 216 ), nRGB( 255, 255, 255 ) } } )

Return(nil)

//-----------------
Func StandardGrad()

SetDlgGradient( { { .50, nRGB( 236, 233, 216 ), nRGB( 255, 255, 255 ) } } )

Return(nil)

//--------------------
Func DarkGreyGrad()

SetDlgGradient({{ 0.90, 14671839, 4144959  },{ 0.1, 4144959, 14671839  }})          // .80
*SetDlgGradient( { { 0.87, 16777215, 11513775 },{ 0.87,11513775, 16777215 }})

Return(nil)

//------------------------------------
Func SolidWhite()

SetDlgGradient( { { 0.01,16777215,16777215 },{ 0.01,16777215,16777215 } })

Return(nil)

//--------------------
Func SolidGrey()

SetDlgGradient( { { .50, nRGB( 233, 233, 233 ), nRGB( 233, 233, 233 ) } } )

Return(nil)

//--------------------
Func SolidChoral()

*SetDlgGradient( { { .50, nRGB( 171, 129, 151 ), nRGB( 171, 129, 151 ) } } )  // choral
SetDlgGradient(aGrad := { { 0.01,8388736,8388736 },{ 0.01,8388736,8388736 } })

Return(nil)

//-----------------
Func LightYellow()

SetDlgGradient( { { 0.01,8440801,16777215 },{ 0.75,16777215,8440801 } })

Return(nil)

//-------------------
Func GreenBlueGrad()

SetDlgGradient( { { .50, nRGB( 192, 192, 192 ), nRGB( 45, 121, 147 ) } } )

Return(nil)

 
User avatar
Rick Lipkin
 
Posts: 2616
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Crash with 23.04 GRADIENTFILL()

Postby nageswaragunupudi » Mon Jul 24, 2023 12:28 am

a.) last Element no "Komma"

Old or new, do not end with Comma ("'," ). Because in that case, the last element of the array is NIL. The function does not expect that any element is NIL.

Please ensure that all fractions (the first element in each sub-array) should aggregate to 1.0. If not we may not get the intended effect.

b.) does "slow down" using 3 Elemets

No.
We can have any number or slices.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Crash with 23.04 GRADIENTFILL()

Postby Jimmy » Mon Jul 24, 2023 2:05 am

hi Rick.
Rick Lipkin wrote:Here are some gradient code I use to make make things simple

thx for Answer

my User can use there own Back- / Fore-ground Color so Gradient was made from these Color
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1585
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Crash with 23.04 GRADIENTFILL()

Postby Jimmy » Mon Jul 24, 2023 2:07 am

hi,

thx for Answer,
nageswaragunupudi wrote:We can have any number or slices.

ok, i have try it again

can it have to do with "Ownerdraw" which i use for Combobox :?:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1585
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 95 guests