1. Request for testing - Gradient Rectangle

Hello,
below is my function gradientRect(). It is used to draw nice
gradient rectangles using GDI - fast. I'd appreciate an info about
Windows versions, which can run this - especially Win9x. Thanks.

      Martin <martin.stachon at tiscali.cz>

<Code>

include win32lib.ew
without warning

constant
msimg32 = registerw32Library("msimg32.dll"),
xGradientFill = registerw32Procedure( msimg32, "GradientFill",
{C_LONG,C_POINTER,C_LONG,C_LONG,C_LONG,C_LONG} )

constant
 TRIVERTEX_x     = allot(Long),
 TRIVERTEX_y     = allot(Long),
 TRIVERTEX_Red   = allot(Word),
 TRIVERTEX_Green = allot(Word),
 TRIVERTEX_Blue  = allot(Word),
 TRIVERTEX_Alpha = allot(Word),
 SIZEOF_TRIVERTEX = allotted_size(),

 GRADIENT_RECT_UpperLeft  = allot(Long),
 GRADIENT_RECT_LowerRight = allot(Long),
 SIZEOF_GRADIENT_RECT     = allotted_size()

constant
 GRADIENT_FILL_RECT_H   = #00000000,
 GRADIENT_FILL_RECT_V   = #00000001,
 GRADIENT_FILL_TRIANGLE = #00000002,
 GRADIENT_FILL_OP_FLAG  = #000000FF

global procedure gradientRect(atom id, atom leftColor, atom rightColor, atom x1,
atom y1,
atom x2, atom y2)
 atom hDC, PTRIVERTEX, gRect
 PTRIVERTEX = acquire_mem( 0, 2*SIZEOF_TRIVERTEX )
 store(PTRIVERTEX, TRIVERTEX_x, x1)
 store(PTRIVERTEX, TRIVERTEX_y, y1)
 store(PTRIVERTEX, TRIVERTEX_Red,   and_bits(leftColor, #0000FF)*#100)
 store(PTRIVERTEX, TRIVERTEX_Green, and_bits(leftColor, #00FF00))
 store(PTRIVERTEX, TRIVERTEX_Blue,  and_bits(leftColor, #FF0000)/#100)
 store(PTRIVERTEX, TRIVERTEX_Alpha, 0)

 store(PTRIVERTEX, TRIVERTEX_x     &SIZEOF_TRIVERTEX, x2)
 store(PTRIVERTEX, TRIVERTEX_y     &SIZEOF_TRIVERTEX, y2)
store(PTRIVERTEX, TRIVERTEX_Red   &SIZEOF_TRIVERTEX, and_bits(rightColor,
 #0000FF)*#100)
store(PTRIVERTEX, TRIVERTEX_Green &SIZEOF_TRIVERTEX, and_bits(rightColor,
 #00FF00))
store(PTRIVERTEX, TRIVERTEX_Blue  &SIZEOF_TRIVERTEX, and_bits(rightColor,
 #FF0000)/#100)
 store(PTRIVERTEX, TRIVERTEX_Alpha &SIZEOF_TRIVERTEX, 0)

 gRect = acquire_mem( 0, SIZEOF_GRADIENT_RECT )
 store(gRect, GRADIENT_RECT_UpperLeft,  0)
 store(gRect, GRADIENT_RECT_LowerRight, 1)

 hDC = getDC(id)
 w32Proc(xGradientFill, {hDC, PTRIVERTEX, 2, gRect, 1, GRADIENT_FILL_RECT_H})
 releaseDC(id)
 release_mem(PTRIVERTEX)
 release_mem(gRect)
end procedure

constant win = create(Window, "Win", 0, Default, Default, 500, 500, 0)

procedure onPaint_win(integer self, integer event, sequence params)
gradientRect(win, Green, Blue, 0, 0, 100, 100) -- zelena - modra, pro blazna
 dobra
end procedure
setHandler(win, w32HPaint, routine_id("onPaint_win"))

WinMain(win, Normal)

</code>

new topic     » topic index » view message » categorize

2. Re: Request for testing - Gradient Rectangle

On Sat, 1 Feb 2003 18:53:42 +0100, Martin Stachon
<martin.stachon at worldonline.cz> wrote:

>Hello,
>below is my function gradientRect(). It is used to draw nice
>gradient rectangles using GDI - fast. I'd appreciate an info about
>Windows versions, which can run this - especially Win9x. Thanks.

win98.
win32lib 0.55.1 & 0.55.5 display black to blue,
0.57.12 & 0.58 display green to blue.

Pete
One thing I did notice was that control did not return from WinMain in
0.57.12 but that may be something I have hacked.

new topic     » goto parent     » topic index » view message » categorize

3. Re: Request for testing - Gradient Rectangle

Windows ME works fine

----------------
cheers,
Derek Parnell
----- Original Message -----
From: "Martin Stachon" <martin.stachon at worldonline.cz>
To: "EUforum" <EUforum at topica.com>
Subject: Request for testing - Gradient Rectangle


>
> Hello,
> below is my function gradientRect(). It is used to draw nice
> gradient rectangles using GDI - fast. I'd appreciate an info about
> Windows versions, which can run this - especially Win9x. Thanks.
>
>       Martin <martin.stachon at tiscali.cz>
>
> <Code>
>
> include win32lib.ew
> without warning
>
> constant
> msimg32 = registerw32Library("msimg32.dll"),
> xGradientFill = registerw32Procedure( msimg32, "GradientFill",
> {C_LONG,C_POINTER,C_LONG,C_LONG,C_LONG,C_LONG} )
>
> constant
>  TRIVERTEX_x     = allot(Long),
>  TRIVERTEX_y     = allot(Long),
>  TRIVERTEX_Red   = allot(Word),
>  TRIVERTEX_Green = allot(Word),
>  TRIVERTEX_Blue  = allot(Word),
>  TRIVERTEX_Alpha = allot(Word),
>  SIZEOF_TRIVERTEX = allotted_size(),
>
>  GRADIENT_RECT_UpperLeft  = allot(Long),
>  GRADIENT_RECT_LowerRight = allot(Long),
>  SIZEOF_GRADIENT_RECT     = allotted_size()
>
> constant
>  GRADIENT_FILL_RECT_H   = #00000000,
>  GRADIENT_FILL_RECT_V   = #00000001,
>  GRADIENT_FILL_TRIANGLE = #00000002,
>  GRADIENT_FILL_OP_FLAG  = #000000FF
>
> global procedure gradientRect(atom id, atom leftColor, atom rightColor,
atom x1, atom y1,
> atom x2, atom y2)
>  atom hDC, PTRIVERTEX, gRect
>  PTRIVERTEX = acquire_mem( 0, 2*SIZEOF_TRIVERTEX )
>  store(PTRIVERTEX, TRIVERTEX_x, x1)
>  store(PTRIVERTEX, TRIVERTEX_y, y1)
>  store(PTRIVERTEX, TRIVERTEX_Red,   and_bits(leftColor, #0000FF)*#100)
>  store(PTRIVERTEX, TRIVERTEX_Green, and_bits(leftColor, #00FF00))
>  store(PTRIVERTEX, TRIVERTEX_Blue,  and_bits(leftColor, #FF0000)/#100)
>  store(PTRIVERTEX, TRIVERTEX_Alpha, 0)
>
>  store(PTRIVERTEX, TRIVERTEX_x     &SIZEOF_TRIVERTEX, x2)
>  store(PTRIVERTEX, TRIVERTEX_y     &SIZEOF_TRIVERTEX, y2)
>  store(PTRIVERTEX, TRIVERTEX_Red   &SIZEOF_TRIVERTEX, and_bits(rightColor,
#0000FF)*#100)
>  store(PTRIVERTEX, TRIVERTEX_Green &SIZEOF_TRIVERTEX, and_bits(rightColor,
#00FF00))
>  store(PTRIVERTEX, TRIVERTEX_Blue  &SIZEOF_TRIVERTEX, and_bits(rightColor,
#FF0000)/#100)
>  store(PTRIVERTEX, TRIVERTEX_Alpha &SIZEOF_TRIVERTEX, 0)
>
>  gRect = acquire_mem( 0, SIZEOF_GRADIENT_RECT )
>  store(gRect, GRADIENT_RECT_UpperLeft,  0)
>  store(gRect, GRADIENT_RECT_LowerRight, 1)
>
>  hDC = getDC(id)
>  w32Proc(xGradientFill, {hDC, PTRIVERTEX, 2, gRect, 1,
GRADIENT_FILL_RECT_H})
>  releaseDC(id)
>  release_mem(PTRIVERTEX)
>  release_mem(gRect)
> end procedure
>
> constant win = create(Window, "Win", 0, Default, Default, 500, 500, 0)
>
> procedure onPaint_win(integer self, integer event, sequence params)
>  gradientRect(win, Green, Blue, 0, 0, 100, 100) -- zelena - modra, pro
blazna dobra
> end procedure
> setHandler(win, w32HPaint, routine_id("onPaint_win"))
>
> WinMain(win, Normal)
>
> </code>
>
>
>
> TOPICA - Start your own email discussion group. FREE!
>

new topic     » goto parent     » topic index » view message » categorize

4. Re: Request for testing - Gradient Rectangle

..well now, msimg32.dll isn't normally found on a 'plain' Win95a,
but, if you've got it, it'll work... Black to Blue... using EU2.2  ;)

> Windows versions, which can run this - especially Win9x. Thanks.

new topic     » goto parent     » topic index » view message » categorize

5. Re: Request for testing - Gradient Rectangle

works great, but how do i make it vertical?

~Greg
g.haberek at comcast.net

----- Original Message ----- 
From: Martin Stachon <martin.stachon at worldonline.cz>
Subject: Request for testing - Gradient Rectangle



Hello,
below is my function gradientRect(). It is used to draw nice
gradient rectangles using GDI - fast. I'd appreciate an info about
Windows versions, which can run this - especially Win9x. Thanks.

      Martin <martin.stachon at tiscali.cz>

<Code>

include win32lib.ew
without warning

constant
msimg32 = registerw32Library("msimg32.dll"),
xGradientFill = registerw32Procedure( msimg32, "GradientFill",
{C_LONG,C_POINTER,C_LONG,C_LONG,C_LONG,C_LONG} )

constant
 TRIVERTEX_x     = allot(Long),
 TRIVERTEX_y     = allot(Long),
 TRIVERTEX_Red   = allot(Word),
 TRIVERTEX_Green = allot(Word),
 TRIVERTEX_Blue  = allot(Word),
 TRIVERTEX_Alpha = allot(Word),
 SIZEOF_TRIVERTEX = allotted_size(),

 GRADIENT_RECT_UpperLeft  = allot(Long),
 GRADIENT_RECT_LowerRight = allot(Long),
 SIZEOF_GRADIENT_RECT     = allotted_size()

constant
 GRADIENT_FILL_RECT_H   = #00000000,
 GRADIENT_FILL_RECT_V   = #00000001,
 GRADIENT_FILL_TRIANGLE = #00000002,
 GRADIENT_FILL_OP_FLAG  = #000000FF

global procedure gradientRect(atom id, atom leftColor, atom rightColor, atom x1,
atom y1,
atom x2, atom y2)
 atom hDC, PTRIVERTEX, gRect
 PTRIVERTEX = acquire_mem( 0, 2*SIZEOF_TRIVERTEX )
 store(PTRIVERTEX, TRIVERTEX_x, x1)
 store(PTRIVERTEX, TRIVERTEX_y, y1)
 store(PTRIVERTEX, TRIVERTEX_Red,   and_bits(leftColor, #0000FF)*#100)
 store(PTRIVERTEX, TRIVERTEX_Green, and_bits(leftColor, #00FF00))
 store(PTRIVERTEX, TRIVERTEX_Blue,  and_bits(leftColor, #FF0000)/#100)
 store(PTRIVERTEX, TRIVERTEX_Alpha, 0)

 store(PTRIVERTEX, TRIVERTEX_x     &SIZEOF_TRIVERTEX, x2)
 store(PTRIVERTEX, TRIVERTEX_y     &SIZEOF_TRIVERTEX, y2)
store(PTRIVERTEX, TRIVERTEX_Red   &SIZEOF_TRIVERTEX, and_bits(rightColor,
 #0000FF)*#100)
store(PTRIVERTEX, TRIVERTEX_Green &SIZEOF_TRIVERTEX, and_bits(rightColor,
 #00FF00))
store(PTRIVERTEX, TRIVERTEX_Blue  &SIZEOF_TRIVERTEX, and_bits(rightColor,
 #FF0000)/#100)
 store(PTRIVERTEX, TRIVERTEX_Alpha &SIZEOF_TRIVERTEX, 0)

 gRect = acquire_mem( 0, SIZEOF_GRADIENT_RECT )
 store(gRect, GRADIENT_RECT_UpperLeft,  0)
 store(gRect, GRADIENT_RECT_LowerRight, 1)

 hDC = getDC(id)
 w32Proc(xGradientFill, {hDC, PTRIVERTEX, 2, gRect, 1, GRADIENT_FILL_RECT_H})
 releaseDC(id)
 release_mem(PTRIVERTEX)
 release_mem(gRect)
end procedure

constant win = create(Window, "Win", 0, Default, Default, 500, 500, 0)

procedure onPaint_win(integer self, integer event, sequence params)
gradientRect(win, Green, Blue, 0, 0, 100, 100) -- zelena - modra, pro blazna
 dobra
end procedure
setHandler(win, w32HPaint, routine_id("onPaint_win"))

WinMain(win, Normal)

</code>



TOPICA - Start your own email discussion group. FREE!

new topic     » goto parent     » topic index » view message » categorize

6. Re: Request for testing - Gradient Rectangle

On 1 Feb 2003, at 18:53, Martin Stachon wrote:

> 
> Hello,
> below is my function gradientRect(). It is used to draw nice
> gradient rectangles using GDI - fast. I'd appreciate an info about
> Windows versions, which can run this - especially Win9x. Thanks.

On win95, i got this:

D:\Euphoria\gradient rectangles\gradrect.exw:6
registerw32Library has not been declared
msimg32 = registerw32Library("msimg32.dll"),
                           ^


Kat

new topic     » goto parent     » topic index » view message » categorize

7. Re: Request for testing - Gradient Rectangle

Martin,

It appears to "work" on 98 1st ed., but looks like it could be a better
gradient somehow; what I see is a *band* of solid green on the left, a
*band* of solid blue on the right, and a kind of "speckled" pseudo-gradient
in the middle.

I can't think of a good suggestion of how to make it better, though.

Dan Moyer


----- Original Message -----
From: "Martin Stachon" <martin.stachon at worldonline.cz>
To: "EUforum" <EUforum at topica.com>
Sent: Saturday, February 01, 2003 9:53 AM
Subject: Request for testing - Gradient Rectangle


>
> Hello,
> below is my function gradientRect(). It is used to draw nice
> gradient rectangles using GDI - fast. I'd appreciate an info about
> Windows versions, which can run this - especially Win9x. Thanks.
>
>       Martin <martin.stachon at tiscali.cz>
>
> <Code>
>
> include win32lib.ew
> without warning
>
> constant
> msimg32 = registerw32Library("msimg32.dll"),
> xGradientFill = registerw32Procedure( msimg32, "GradientFill",
> {C_LONG,C_POINTER,C_LONG,C_LONG,C_LONG,C_LONG} )
>
> constant
>  TRIVERTEX_x     = allot(Long),
>  TRIVERTEX_y     = allot(Long),
>  TRIVERTEX_Red   = allot(Word),
>  TRIVERTEX_Green = allot(Word),
>  TRIVERTEX_Blue  = allot(Word),
>  TRIVERTEX_Alpha = allot(Word),
>  SIZEOF_TRIVERTEX = allotted_size(),
>
>  GRADIENT_RECT_UpperLeft  = allot(Long),
>  GRADIENT_RECT_LowerRight = allot(Long),
>  SIZEOF_GRADIENT_RECT     = allotted_size()
>
> constant
>  GRADIENT_FILL_RECT_H   = #00000000,
>  GRADIENT_FILL_RECT_V   = #00000001,
>  GRADIENT_FILL_TRIANGLE = #00000002,
>  GRADIENT_FILL_OP_FLAG  = #000000FF
>
> global procedure gradientRect(atom id, atom leftColor, atom rightColor,
atom x1, atom y1,
> atom x2, atom y2)
>  atom hDC, PTRIVERTEX, gRect
>  PTRIVERTEX = acquire_mem( 0, 2*SIZEOF_TRIVERTEX )
>  store(PTRIVERTEX, TRIVERTEX_x, x1)
>  store(PTRIVERTEX, TRIVERTEX_y, y1)
>  store(PTRIVERTEX, TRIVERTEX_Red,   and_bits(leftColor, #0000FF)*#100)
>  store(PTRIVERTEX, TRIVERTEX_Green, and_bits(leftColor, #00FF00))
>  store(PTRIVERTEX, TRIVERTEX_Blue,  and_bits(leftColor, #FF0000)/#100)
>  store(PTRIVERTEX, TRIVERTEX_Alpha, 0)
>
>  store(PTRIVERTEX, TRIVERTEX_x     &SIZEOF_TRIVERTEX, x2)
>  store(PTRIVERTEX, TRIVERTEX_y     &SIZEOF_TRIVERTEX, y2)
>  store(PTRIVERTEX, TRIVERTEX_Red   &SIZEOF_TRIVERTEX, and_bits(rightColor,
#0000FF)*#100)
>  store(PTRIVERTEX, TRIVERTEX_Green &SIZEOF_TRIVERTEX, and_bits(rightColor,
#00FF00))
>  store(PTRIVERTEX, TRIVERTEX_Blue  &SIZEOF_TRIVERTEX, and_bits(rightColor,
#FF0000)/#100)
>  store(PTRIVERTEX, TRIVERTEX_Alpha &SIZEOF_TRIVERTEX, 0)
>
>  gRect = acquire_mem( 0, SIZEOF_GRADIENT_RECT )
>  store(gRect, GRADIENT_RECT_UpperLeft,  0)
>  store(gRect, GRADIENT_RECT_LowerRight, 1)
>
>  hDC = getDC(id)
>  w32Proc(xGradientFill, {hDC, PTRIVERTEX, 2, gRect, 1,
GRADIENT_FILL_RECT_H})
>  releaseDC(id)
>  release_mem(PTRIVERTEX)
>  release_mem(gRect)
> end procedure
>
> constant win = create(Window, "Win", 0, Default, Default, 500, 500, 0)
>
> procedure onPaint_win(integer self, integer event, sequence params)
>  gradientRect(win, Green, Blue, 0, 0, 100, 100) -- zelena - modra, pro
blazna dobra
> end procedure
> setHandler(win, w32HPaint, routine_id("onPaint_win"))
>
> WinMain(win, Normal)
>
> </code>
>
>
>
> TOPICA - Start your own email discussion group. FREE!
>

new topic     » goto parent     » topic index » view message » categorize

8. Re: Request for testing - Gradient Rectangle

>From: Dan Moyer <DANIELMOYER at prodigy.net>
>Subject: Re: Request for testing - Gradient Rectangle
>
>
>Martin,
>
>It appears to "work" on 98 1st ed., but looks like it could be a better
>gradient somehow; what I see is a *band* of solid green on the left, a
>*band* of solid blue on the right, and a kind of "speckled" pseudo-gradient
>in the middle.

  Sounds like dithering. Is your display set to a low bit-depth, like 
256-colours?

>I can't think of a good suggestion of how to make it better, though.
>
>Dan Moyer
>
>
>----- Original Message -----
>From: "Martin Stachon" <martin.stachon at worldonline.cz>
>To: "EUforum" <EUforum at topica.com>
>Sent: Saturday, February 01, 2003 9:53 AM
>Subject: Request for testing - Gradient Rectangle
>
>
> > Hello,
> > below is my function gradientRect(). It is used to draw nice
> > gradient rectangles using GDI - fast. I'd appreciate an info about
> > Windows versions, which can run this - especially Win9x. Thanks.
> >
> >       Martin <martin.stachon at tiscali.cz>
> >
> > <Code>
> >
> > include win32lib.ew
> > without warning
> >
> > constant
> > msimg32 = registerw32Library("msimg32.dll"),
> > xGradientFill = registerw32Procedure( msimg32, "GradientFill",
> > {C_LONG,C_POINTER,C_LONG,C_LONG,C_LONG,C_LONG} )
> >
> > constant
> >  TRIVERTEX_x     = allot(Long),
> >  TRIVERTEX_y     = allot(Long),
> >  TRIVERTEX_Red   = allot(Word),
> >  TRIVERTEX_Green = allot(Word),
> >  TRIVERTEX_Blue  = allot(Word),
> >  TRIVERTEX_Alpha = allot(Word),
> >  SIZEOF_TRIVERTEX = allotted_size(),
> >
> >  GRADIENT_RECT_UpperLeft  = allot(Long),
> >  GRADIENT_RECT_LowerRight = allot(Long),
> >  SIZEOF_GRADIENT_RECT     = allotted_size()
> >
> > constant
> >  GRADIENT_FILL_RECT_H   = #00000000,
> >  GRADIENT_FILL_RECT_V   = #00000001,
> >  GRADIENT_FILL_TRIANGLE = #00000002,
> >  GRADIENT_FILL_OP_FLAG  = #000000FF
> >
> > global procedure gradientRect(atom id, atom leftColor, atom rightColor,
>atom x1, atom y1,
> > atom x2, atom y2)
> >  atom hDC, PTRIVERTEX, gRect
> >  PTRIVERTEX = acquire_mem( 0, 2*SIZEOF_TRIVERTEX )
> >  store(PTRIVERTEX, TRIVERTEX_x, x1)
> >  store(PTRIVERTEX, TRIVERTEX_y, y1)
> >  store(PTRIVERTEX, TRIVERTEX_Red,   and_bits(leftColor, #0000FF)*#100)
> >  store(PTRIVERTEX, TRIVERTEX_Green, and_bits(leftColor, #00FF00))
> >  store(PTRIVERTEX, TRIVERTEX_Blue,  and_bits(leftColor, #FF0000)/#100)
> >  store(PTRIVERTEX, TRIVERTEX_Alpha, 0)
> >
> >  store(PTRIVERTEX, TRIVERTEX_x     &SIZEOF_TRIVERTEX, x2)
> >  store(PTRIVERTEX, TRIVERTEX_y     &SIZEOF_TRIVERTEX, y2)
> >  store(PTRIVERTEX, TRIVERTEX_Red   &SIZEOF_TRIVERTEX, 
>and_bits(rightColor,
>#0000FF)*#100)
> >  store(PTRIVERTEX, TRIVERTEX_Green &SIZEOF_TRIVERTEX, 
>and_bits(rightColor,
>#00FF00))
> >  store(PTRIVERTEX, TRIVERTEX_Blue  &SIZEOF_TRIVERTEX, 
>and_bits(rightColor,
>#FF0000)/#100)
> >  store(PTRIVERTEX, TRIVERTEX_Alpha &SIZEOF_TRIVERTEX, 0)
> >
> >  gRect = acquire_mem( 0, SIZEOF_GRADIENT_RECT )
> >  store(gRect, GRADIENT_RECT_UpperLeft,  0)
> >  store(gRect, GRADIENT_RECT_LowerRight, 1)
> >
> >  hDC = getDC(id)
> >  w32Proc(xGradientFill, {hDC, PTRIVERTEX, 2, gRect, 1,
>GRADIENT_FILL_RECT_H})
> >  releaseDC(id)
> >  release_mem(PTRIVERTEX)
> >  release_mem(gRect)
> > end procedure
> >
> > constant win = create(Window, "Win", 0, Default, Default, 500, 500, 0)
> >
> > procedure onPaint_win(integer self, integer event, sequence params)
> >  gradientRect(win, Green, Blue, 0, 0, 100, 100) -- zelena - modra, pro
>blazna dobra
> > end procedure
> > setHandler(win, w32HPaint, routine_id("onPaint_win"))
> >
> > WinMain(win, Normal)
> >
> > </code>
> >
> >
<snip>

>
>

new topic     » goto parent     » topic index » view message » categorize

9. Re: Request for testing - Gradient Rectangle

Yep, you (& Wolf) are right, it's at 256, didn't realize it.

Dan Moyer

----- Original Message -----
From: "Elliott Sales de Andrade" <quantum_analyst at hotmail.com>
To: "EUforum" <EUforum at topica.com>
Subject: Re: Request for testing - Gradient Rectangle


>
>
> >From: Dan Moyer <DANIELMOYER at prodigy.net>
> >Reply-To: EUforum at topica.com
> >To: EUforum <EUforum at topica.com>
> >Subject: Re: Request for testing - Gradient Rectangle
> >Date: Sat, 1 Feb 2003 20:10:50 -0800
> >
> >
> >Martin,
> >
> >It appears to "work" on 98 1st ed., but looks like it could be a better
> >gradient somehow; what I see is a *band* of solid green on the left, a
> >*band* of solid blue on the right, and a kind of "speckled"
pseudo-gradient
> >in the middle.
>
>   Sounds like dithering. Is your display set to a low bit-depth, like
> 256-colours?
>
> >I can't think of a good suggestion of how to make it better, though.
> >
> >Dan Moyer
> >
> >
> >----- Original Message -----
> >From: "Martin Stachon" <martin.stachon at worldonline.cz>
> >To: "EUforum" <EUforum at topica.com>
> >Sent: Saturday, February 01, 2003 9:53 AM
> >Subject: Request for testing - Gradient Rectangle
> >
> >
> > > Hello,
> > > below is my function gradientRect(). It is used to draw nice
> > > gradient rectangles using GDI - fast. I'd appreciate an info about
> > > Windows versions, which can run this - especially Win9x. Thanks.
> > >
> > >       Martin <martin.stachon at tiscali.cz>
> > >
> > > <Code>
> > >
> > > include win32lib.ew
> > > without warning
> > >
> > > constant
> > > msimg32 = registerw32Library("msimg32.dll"),
> > > xGradientFill = registerw32Procedure( msimg32, "GradientFill",
> > > {C_LONG,C_POINTER,C_LONG,C_LONG,C_LONG,C_LONG} )
> > >
> > > constant
> > >  TRIVERTEX_x     = allot(Long),
> > >  TRIVERTEX_y     = allot(Long),
> > >  TRIVERTEX_Red   = allot(Word),
> > >  TRIVERTEX_Green = allot(Word),
> > >  TRIVERTEX_Blue  = allot(Word),
> > >  TRIVERTEX_Alpha = allot(Word),
> > >  SIZEOF_TRIVERTEX = allotted_size(),
> > >
> > >  GRADIENT_RECT_UpperLeft  = allot(Long),
> > >  GRADIENT_RECT_LowerRight = allot(Long),
> > >  SIZEOF_GRADIENT_RECT     = allotted_size()
> > >
> > > constant
> > >  GRADIENT_FILL_RECT_H   = #00000000,
> > >  GRADIENT_FILL_RECT_V   = #00000001,
> > >  GRADIENT_FILL_TRIANGLE = #00000002,
> > >  GRADIENT_FILL_OP_FLAG  = #000000FF
> > >
> > > global procedure gradientRect(atom id, atom leftColor, atom
rightColor,
> >atom x1, atom y1,
> > > atom x2, atom y2)
> > >  atom hDC, PTRIVERTEX, gRect
> > >  PTRIVERTEX = acquire_mem( 0, 2*SIZEOF_TRIVERTEX )
> > >  store(PTRIVERTEX, TRIVERTEX_x, x1)
> > >  store(PTRIVERTEX, TRIVERTEX_y, y1)
> > >  store(PTRIVERTEX, TRIVERTEX_Red,   and_bits(leftColor, #0000FF)*#100)
> > >  store(PTRIVERTEX, TRIVERTEX_Green, and_bits(leftColor, #00FF00))
> > >  store(PTRIVERTEX, TRIVERTEX_Blue,  and_bits(leftColor, #FF0000)/#100)
> > >  store(PTRIVERTEX, TRIVERTEX_Alpha, 0)
> > >
> > >  store(PTRIVERTEX, TRIVERTEX_x     &SIZEOF_TRIVERTEX, x2)
> > >  store(PTRIVERTEX, TRIVERTEX_y     &SIZEOF_TRIVERTEX, y2)
> > >  store(PTRIVERTEX, TRIVERTEX_Red   &SIZEOF_TRIVERTEX,
> >and_bits(rightColor,
> >#0000FF)*#100)
> > >  store(PTRIVERTEX, TRIVERTEX_Green &SIZEOF_TRIVERTEX,
> >and_bits(rightColor,
> >#00FF00))
> > >  store(PTRIVERTEX, TRIVERTEX_Blue  &SIZEOF_TRIVERTEX,
> >and_bits(rightColor,
> >#FF0000)/#100)
> > >  store(PTRIVERTEX, TRIVERTEX_Alpha &SIZEOF_TRIVERTEX, 0)
> > >
> > >  gRect = acquire_mem( 0, SIZEOF_GRADIENT_RECT )
> > >  store(gRect, GRADIENT_RECT_UpperLeft,  0)
> > >  store(gRect, GRADIENT_RECT_LowerRight, 1)
> > >
> > >  hDC = getDC(id)
> > >  w32Proc(xGradientFill, {hDC, PTRIVERTEX, 2, gRect, 1,
> >GRADIENT_FILL_RECT_H})
> > >  releaseDC(id)
> > >  release_mem(PTRIVERTEX)
> > >  release_mem(gRect)
> > > end procedure
> > >
> > > constant win = create(Window, "Win", 0, Default, Default, 500, 500, 0)
> > >
> > > procedure onPaint_win(integer self, integer event, sequence params)
> > >  gradientRect(win, Green, Blue, 0, 0, 100, 100) -- zelena - modra, pro
> >blazna dobra
> > > end procedure
> > > setHandler(win, w32HPaint, routine_id("onPaint_win"))
> > >
> > > WinMain(win, Normal)
> > >
> > > </code>
> > >
> > >
> <snip>
>
> >
>
>
> TOPICA - Start your own email discussion group. FREE!
>

new topic     » goto parent     » topic index » view message » categorize

10. Re: Request for testing - Gradient Rectangle

Just replace GRADIENT_FILL_RECT_H with GRADIENT_FILL_RECT_V
in GradientFill() call.

    Martin

Greg wrote:
>
> works great, but how do i make it vertical?
>
> ~Greg
> g.haberek at comcast.net
>
> ----- Original Message -----
> From: Martin Stachon <martin.stachon at worldonline.cz>
> Subject: Request for testing - Gradient Rectangle
>
>
> Hello,
> below is my function gradientRect(). It is used to draw nice
> gradient rectangles using GDI - fast. I'd appreciate an info about
> Windows versions, which can run this - especially Win9x. Thanks.
>
>       Martin <martin.stachon at tiscali.cz>
>
> <Code>
>
> include win32lib.ew
> without warning
>
> constant
> msimg32 = registerw32Library("msimg32.dll"),
> xGradientFill = registerw32Procedure( msimg32, "GradientFill",
> {C_LONG,C_POINTER,C_LONG,C_LONG,C_LONG,C_LONG} )
>
> constant
>  TRIVERTEX_x     = allot(Long),
>  TRIVERTEX_y     = allot(Long),
>  TRIVERTEX_Red   = allot(Word),
>  TRIVERTEX_Green = allot(Word),
>  TRIVERTEX_Blue  = allot(Word),
>  TRIVERTEX_Alpha = allot(Word),
>  SIZEOF_TRIVERTEX = allotted_size(),
>
>  GRADIENT_RECT_UpperLeft  = allot(Long),
>  GRADIENT_RECT_LowerRight = allot(Long),
>  SIZEOF_GRADIENT_RECT     = allotted_size()
>
> constant
>  GRADIENT_FILL_RECT_H   = #00000000,
>  GRADIENT_FILL_RECT_V   = #00000001,
>  GRADIENT_FILL_TRIANGLE = #00000002,
>  GRADIENT_FILL_OP_FLAG  = #000000FF
>
> global procedure gradientRect(atom id, atom leftColor, atom rightColor, atom
> x1, atom
y1,
> atom x2, atom y2)
>  atom hDC, PTRIVERTEX, gRect
>  PTRIVERTEX = acquire_mem( 0, 2*SIZEOF_TRIVERTEX )
>  store(PTRIVERTEX, TRIVERTEX_x, x1)
>  store(PTRIVERTEX, TRIVERTEX_y, y1)
>  store(PTRIVERTEX, TRIVERTEX_Red,   and_bits(leftColor, #0000FF)*#100)
>  store(PTRIVERTEX, TRIVERTEX_Green, and_bits(leftColor, #00FF00))
>  store(PTRIVERTEX, TRIVERTEX_Blue,  and_bits(leftColor, #FF0000)/#100)
>  store(PTRIVERTEX, TRIVERTEX_Alpha, 0)
>
>  store(PTRIVERTEX, TRIVERTEX_x     &SIZEOF_TRIVERTEX, x2)
>  store(PTRIVERTEX, TRIVERTEX_y     &SIZEOF_TRIVERTEX, y2)
>  store(PTRIVERTEX, TRIVERTEX_Red   &SIZEOF_TRIVERTEX, and_bits(rightColor,
#0000FF)*#100)
>  store(PTRIVERTEX, TRIVERTEX_Green &SIZEOF_TRIVERTEX, and_bits(rightColor,
>  #00FF00))
>  store(PTRIVERTEX, TRIVERTEX_Blue  &SIZEOF_TRIVERTEX, and_bits(rightColor,
#FF0000)/#100)
>  store(PTRIVERTEX, TRIVERTEX_Alpha &SIZEOF_TRIVERTEX, 0)
>
>  gRect = acquire_mem( 0, SIZEOF_GRADIENT_RECT )
>  store(gRect, GRADIENT_RECT_UpperLeft,  0)
>  store(gRect, GRADIENT_RECT_LowerRight, 1)
>
>  hDC = getDC(id)
>  w32Proc(xGradientFill, {hDC, PTRIVERTEX, 2, gRect, 1, GRADIENT_FILL_RECT_H})
>  releaseDC(id)
>  release_mem(PTRIVERTEX)
>  release_mem(gRect)
> end procedure
>
> constant win = create(Window, "Win", 0, Default, Default, 500, 500, 0)
>
> procedure onPaint_win(integer self, integer event, sequence params)
>  gradientRect(win, Green, Blue, 0, 0, 100, 100) -- zelena - modra, pro blazna
>  dobra
> end procedure
> setHandler(win, w32HPaint, routine_id("onPaint_win"))
>
> WinMain(win, Normal)
>
> </code>
>
>
> TOPICA - Start your own email discussion group. FREE!
>
>
>
> TOPICA - Start your own email discussion group. FREE!
>

new topic     » goto parent     » topic index » view message » categorize

11. Re: Request for testing - Gradient Rectangle

Kat wrote:
> On 1 Feb 2003, at 18:53, Martin Stachon wrote:
> 
> > 
> > Hello,
> > below is my function gradientRect(). It is used to draw nice
> > gradient rectangles using GDI - fast. I'd appreciate an info about
> > Windows versions, which can run this - especially Win9x. Thanks.
> 
> On win95, i got this:
> 
> D:\Euphoria\gradient rectangles\gradrect.exw:6
> registerw32Library has not been declared
> msimg32 = registerw32Library("msimg32.dll"),
>                            ^

You need win32lib at least v0.55.1

    Martin

new topic     » goto parent     » topic index » view message » categorize

12. Re: Request for testing - Gradient Rectangle

Thanks to all for testing. So it should be working on all
systems except the old Win95, right?

Pete Lomax wrote:
> win98.
> win32lib 0.55.1 & 0.55.5 display black to blue,
> 0.57.12 & 0.58 display green to blue.

I can't understant why 0.55.x displays black instead of
green. The color is defined as

    Green = rgb(0, 128, 0)

in both versions. Also rgb() function is same. 
Any ideas? How about other colors? Thanks.

    Martin

new topic     » goto parent     » topic index » view message » categorize

13. Re: Request for testing - Gradient Rectangle

On 2 Feb 2003, at 10:20, Martin Stachon wrote:

> 
> Thanks to all for testing. So it should be working on all
> systems except the old Win95, right?

Got win32lib v0.55.1, then got a bunch of cannot find errors, then a missing 
dll error about msimg32.dll . What is it, and why?

Kat
 
> Pete Lomax wrote:
> > win98.
> > win32lib 0.55.1 & 0.55.5 display black to blue,
> > 0.57.12 & 0.58 display green to blue.
> 
> I can't understant why 0.55.x displays black instead of
> green. The color is defined as
> 
>     Green = rgb(0, 128, 0)
> 
> in both versions. Also rgb() function is same. 
> Any ideas? How about other colors? Thanks.
> 
>     Martin
> 
> 
> 
> TOPICA - Start your own email discussion group. FREE!
>

new topic     » goto parent     » topic index » view message » categorize

14. Re: Request for testing - Gradient Rectangle

Kat wrote:
> > Thanks to all for testing. So it should be working on all
> > systems except the old Win95, right?
>
> Got win32lib v0.55.1, then got a bunch of cannot find errors, then a missing
> dll error about msimg32.dll . What is it, and why?

You haven't explained what "cannot find" errors. But the dll errors are bacause
you haven't got msimg32.dll (as Wolf said). I will probably also put in an
emulation
routine for Win95 to draw the gradient using lines (as in my Towers of Hanoi
demo), but,
win32lib already does not work well with Win95, and anyway, who is using Win95
these days
?
;)

    Martin

new topic     » goto parent     » topic index » view message » categorize

15. Re: Request for testing - Gradient Rectangle

On Sun, 2 Feb 2003 05:06:49 -0600, gertie at visionsix.com wrote:

>Got win32lib v0.55.1, then got a bunch of cannot find errors, then a =
missing=20
>dll error about msimg32.dll . What is it, and why?
It was first released with NT 5.0 and contains gradient fill and
transparentBlt. I think it should work on 95.

Try: http://www.invisiblekeylogger.com/MSIMG32.DLL
or: http://www.fox-box.com/dll/m/msimg32.zip
(both of those are the 52K NT5 version which ships with win98)

put it in your windows/system directory.

Warning - there are win2000 versions of this DLL, much smaller at 5K,
which will NOT work with win98.

Pete
PS Martin, have you got it drawing triangles yet?

new topic     » goto parent     » topic index » view message » categorize

16. Re: Request for testing - Gradient Rectangle

On 2 Feb 2003, at 15:26, Martin Stachon wrote:

> 
> Kat wrote:
> > > Thanks to all for testing. So it should be working on all
> > > systems except the old Win95, right?
> >
> > Got win32lib v0.55.1, then got a bunch of cannot find errors, then a missing
> > dll error about msimg32.dll . What is it, and why?
> 
> You haven't explained what "cannot find" errors. 

Missing include files.

> But the dll errors are bacause
> you haven't got msimg32.dll (as Wolf said). I will probably also put in an
> emulation routine for Win95 to draw the gradient using lines (as in my Towers
> of
> Hanoi demo), but, win32lib already does not work well with Win95, 

Which explains why i keep the old versions.

> and anyway,
> who is using Win95 these days ? ;)

Me. Go ahead and laugh. I don't see the humor. I was able to get win95 from 
the last geek i met in real life, in 1996. I haven't known anyone in real life
who
could do more than turn on the computer since then, so i haven't seen a 
working OS other than mine. Since i can't get anyone to help online with nix, 
and no one in real life can help, i'll stick with win95 till something better 
comes along. I tried DRdos, it wouldn't install, and they wanted $500 for the 
source code. So you guys go ahead and write code that won't run on win95, 
everyone else is, including trojan and virus writers. tongue

Kat

new topic     » goto parent     » topic index » view message » categorize

17. Re: Request for testing - Gradient Rectangle

On Sun, Feb 02, 2003 at 02:30:54PM -0600, gertie at visionsix.com wrote:
> 
> On 2 Feb 2003, at 15:26, Martin Stachon wrote:
<snip> 
> Missing include files.
> 
> > But the dll errors are bacause
> > you haven't got msimg32.dll (as Wolf said). I will probably also put in an
> > emulation routine for Win95 to draw the gradient using lines (as in my
> > Towers of
> > Hanoi demo), but, win32lib already does not work well with Win95, 
> 
> Which explains why i keep the old versions.

Sheesh! Win95 is Win32, I can understand adding features to win32lib that
enhance it for newer versions of Windoze, but it should also work for the
older versions (minus enhancements of course).

IMHO, the fact that Win32lib doesn't run under Win95 would seem ludicrous to
me ... but I'm betting there aren't any developers of Win32lib who use
Win95 regularly. (Instead of editing win32lib to work on vanilla win95,
perhaps a set of dlls could be included/linked to which are needed to get
win32lib to run but arent part of win95 by default?)

> 
> > and anyway,
> > who is using Win95 these days ? ;)
> 
> Me. Go ahead and laugh. I don't see the humor. I was able to get win95 from 
> the last geek i met in real life, in 1996. I haven't known anyone in real life
> who
> could do more than turn on the computer since then, so i haven't seen a 
> working OS other than mine. Since i can't get anyone to help online with nix, 
> and no one in real life can help, i'll stick with win95 till something better 
> comes along. I tried DRdos, it wouldn't install, and they wanted $500 for the 
> source code. So you guys go ahead and write code that won't run on win95, 
> everyone else is, including trojan and virus writers. tongue
> 
> Kat

LOL on that bit about trojan&virus writers.

I used Windows 95 onces, I found the Win9x line of OSes to be the very worst
of OSes. (Its hard to fault M$ entirely on this, however, their choice of
making 9x a mixed 32/16bit OS was asking to make it extremely bug prone.)
WinNT is quite better, but also much more expensive. (2k = NT 5.0, XP = 5.1,
btw, they are part of the NT line.)

If you still want to learn linux on your own, try going to www.linux.org or
www.linux.com and browsing thru the docs on the sites. (A hint: Linux might
not work perfectly on the lastest hardware, but it tends to run great
on boxes 5 years old which sell really cheap.)

Also, Cygwin (which should work on Win95, at least it did 2 years ago
when I tried it) provides a Unix layer under Windows. You can practice
ls, rm, cp, mv, mc, bash script shells, etc. within the confort of Windows
if you wish ... however, Cygwin is still experimental and buggy, so
if you use it at all keep that in mind.

Not Sure If That Helps,
jbrown

> 
> 
> 
> TOPICA - Start your own email discussion group. FREE!

-- 
 /"\  ASCII ribbon              | 
 \ /  campain against           | Linux User:190064
  X   HTML in e-mail and        | Linux Machine:84163
 /*\  news, and unneeded MIME   |

new topic     » goto parent     » topic index » view message » categorize

18. Re: Request for testing - Gradient Rectangle

> IMHO, the fact that Win32lib doesn't run under Win95 would seem ludicrous to
> me ... but I'm betting there aren't any developers of Win32lib who use
> Win95 regularly. (Instead of editing win32lib to work on vanilla win95,
> perhaps a set of dlls could be included/linked to which are needed to get
> win32lib to run but arent part of win95 by default?)

Works OK for me on an old Win95 box with some minor updates.
401comupd.exe gives you comctl32.dll ver.4.72,
Riched30.exe gives you riched20.dll ver.5.30...
... both from M$, and other sources.
( perhaps both are in IE 4.01 ? )
Avoid 50comupd.exe, unless you've got at least a P166, it's *slow*,
... and seems to actually break the old Internet Mail and News proggy.

I think the only ( trivial ) function missing would be getWindowInfo(),
only in newer user32's.

new topic     » goto parent     » topic index » view message » categorize

19. Re: Request for testing - Gradient Rectangle

Pete Lomax wrote:
> PS Martin, have you got it drawing triangles yet?

I will soon release a small library with the gradient functions...

    Martin

new topic     » goto parent     » topic index » view message » categorize

20. Re: Request for testing - Gradient Rectangle

Kat wrote:
> Missing include files.

win32lib also needs its additional includes, tk_*.e and w32keys.ew

> > and anyway,
> > who is using Win95 these days ? ;)
> 
> Me. Go ahead and laugh. I don't see the humor. I was able to get win95 from 
> the last geek i met in real life, in 1996. I haven't known anyone in real life
> who
> could do more than turn on the computer since then, so i haven't seen a 
> working OS other than mine. Since i can't get anyone to help online with nix, 
> and no one in real life can help, i'll stick with win95 till something better 
> comes along. I tried DRdos, it wouldn't install, and they wanted $500 for the 
> source code. 

The popular Linux distributions, like Mandrake and RedHat are very easy to use.
These days, they will install automatically (like Windows do), if your hardware
is plug'n'play (ACPI and such). But Jim will surely say something on this...
There are also other alternative free OSes (But with less applications)

Not guiding you to piracy, but Win98 installation files are only 112 MB...

> So you guys go ahead and write code that won't run on win95, 
> everyone else is, including trojan and virus writers. tongue

The mainstream OS always gets the most of trojans/virus. If all
people would be using UNIX, there would be lots of viruses for UNIX
simply because people are foolish enough to run unknown programs
as root.

    Martin

new topic     » goto parent     » topic index » view message » categorize

21. Re: Request for testing - Gradient Rectangle

On Wed, Feb 05, 2003 at 05:25:46PM +0100, Martin Stachon wrote:
> 
> Kat wrote:
<snip>
> The popular Linux distributions, like Mandrake and RedHat are very easy to
> use.
> These days, they will install automatically (like Windows do), if your
> hardware
> is plug'n'play (ACPI and such). But Jim will surely say something on this...
> There are also other alternative free OSes (But with less applications)

FreeBSD, OpenBSD, and NetBSD ... haven't tried any of these, but from what
I've read, these BSDs arent for the beginner (with the possible exception of
FreeBSD, I suppose).

I haven't tried any recent linux distro, however Redhat 6.0 and Caldera
OpenLinux 2.2 installed for me without problems.

I'd already tried talking to Kat about how to get Linux to work for her,
she tried once several years back, had hardware incompatibilites with the Linux
she was installing, and gave up and never tried again. (She thinks that was such
a
insurmoutable problem, she should hear about the nightmares I had with my
computer a
while back ... and that affected my Win98 a lot worse than it ever did
Linux!)

> 
> Not guiding you to piracy, but Win98 installation files are only 112 MB...

Thats not appealing to dialup users, really. (WinXP is around 500MB from what
I've heard, btw. ;)

> 
> > So you guys go ahead and write code that won't run on win95, 
> > everyone else is, including trojan and virus writers. tongue
> 
> The mainstream OS always gets the most of trojans/virus. If all
> people would be using UNIX, there would be lots of viruses for UNIX
> simply because people are foolish enough to run unknown programs
> as root.

There already are lots of worms for Linux servers. Tho if you stay up to
date you are patched and protected against all but the newborns (a mere
few hours old).

I'd imagine, with OpenSource browsers such as Konqueror, Galeaon, and Mozilla,
the same situation would apply there (patches against the latest viruses).
Same with KMail and other OpenSource e-mail clients, also to news clients,
etc.

Of course, this only workd if one stays up to date against viruses for ALL
open source programs that are used reguarly (or at all). And this approach will
not necessarily work for closed source programs such as the Opera web browser,
to
name one such program for Linux. (Contrary to popular belief, there are many
closed source programs availaible for linux, and many linux users use those
closed source programs.)

> 
>     Martin

jbrown

> 
> 
> 
> TOPICA - Start your own email discussion group. FREE!

-- 
 /"\  ASCII ribbon              | 
 \ /  campain against           | Linux User:190064
  X   HTML in e-mail and        | Linux Machine:84163
 /*\  news, and unneeded MIME   |

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu