$PBExportHeader$n_gradient.sru forward global type n_gradient from nonvisualobject end type type gradient_rect from structure within n_gradient end type type trivertex from structure within n_gradient end type end forward type gradient_rect from structure long upperleft long lowerright end type type trivertex from structure long x long y unsignedinteger red unsignedinteger green unsignedinteger blue unsignedinteger alpha end type global type n_gradient from nonvisualobject autoinstantiate end type type prototypes Function Boolean GradientFill( & Long hDC, & TRIVERTEX pVertex[], & Long nVertex, & GRADIENT_RECT pMesh, & Long nMesh, & Long ulMode & ) Library "msimg32.dll" alias for "GradientFill" end prototypes type variables Constant Long GRADIENT_FILL_RECT_H = 0 Constant Long GRADIENT_FILL_RECT_V = 1 end variables forward prototypes public subroutine vertical (long hdc, integer x, integer y, integer width, integer height, long color1, long color2) public subroutine horizontal (long hdc, integer x, integer y, integer width, integer height, long color1, long color2) end prototypes public subroutine vertical (long hdc, integer x, integer y, integer width, integer height, long color1, long color2);// ----------------------------------------------------------------------------- // SCRIPT: n_gradient.Vertical // // PURPOSE: This function performs a vertical gradient fill. // // ARGUMENTS: hdc - The device context // x - The X coordinate of the rectangle // y - The Y coordinate of the rectangle // width - The Width of the rectangle // height - The Height of the rectangle // color1 - The color of the Top edge // color2 - The color of the Bottom edge // // DATE PROG/ID DESCRIPTION OF CHANGE / REASON // ---------- -------- ----------------------------------------------------- // 07/26/2013 RolandS Initial coding // ----------------------------------------------------------------------------- n_colors ln_colors TRIVERTEX vertex[2] GRADIENT_RECT gRect UInt lui_Red, lui_Green, lui_Blue ln_colors.SplitRGB(color1, lui_Red, lui_Green, lui_Blue) vertex[1].X = x vertex[1].Y = y vertex[1].Red = lui_Red vertex[1].Green = lui_Green vertex[1].Blue = lui_Blue ln_colors.SplitRGB(color2, lui_Red, lui_Green, lui_Blue) vertex[2].X = width vertex[2].Y = height vertex[2].Red = lui_Red vertex[2].Green = lui_Green vertex[2].Blue = lui_Blue gRect.UpperLeft = 0 gRect.LowerRight = 1 GradientFill(hdc, vertex, 2, gRect, 1, GRADIENT_FILL_RECT_V) end subroutine public subroutine horizontal (long hdc, integer x, integer y, integer width, integer height, long color1, long color2);// ----------------------------------------------------------------------------- // SCRIPT: n_gradient.Vertical // // PURPOSE: This function performs a vertical gradient fill. // // ARGUMENTS: hdc - The device context // x - The X coordinate of the rectangle // y - The Y coordinate of the rectangle // width - The Width of the rectangle // height - The Height of the rectangle // color1 - The color of the Left edge // color2 - The color of the Right edge // // DATE PROG/ID DESCRIPTION OF CHANGE / REASON // ---------- -------- ----------------------------------------------------- // 07/26/2013 RolandS Initial coding // ----------------------------------------------------------------------------- n_colors ln_colors TRIVERTEX vertex[2] GRADIENT_RECT gRect UInt lui_Red, lui_Green, lui_Blue ln_colors.SplitRGB(color1, lui_Red, lui_Green, lui_Blue) vertex[1].X = x vertex[1].Y = y vertex[1].Red = lui_Red vertex[1].Green = lui_Green vertex[1].Blue = lui_Blue ln_colors.SplitRGB(color2, lui_Red, lui_Green, lui_Blue) vertex[2].X = width vertex[2].Y = height vertex[2].Red = lui_Red vertex[2].Green = lui_Green vertex[2].Blue = lui_Blue gRect.UpperLeft = 0 gRect.LowerRight = 1 GradientFill(hdc, vertex, 2, gRect, 1, GRADIENT_FILL_RECT_H) end subroutine on n_gradient.create call super::create TriggerEvent( this, "constructor" ) end on on n_gradient.destroy TriggerEvent( this, "destructor" ) call super::destroy end on
File: n_gradient.sru
Size: 4324
Date: Mon, 31 Dec 2018 21:14:38 +0100
Size: 4324
Date: Mon, 31 Dec 2018 21:14:38 +0100