Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.clipper.visual-objects > #9876
| From | "Karl-Heinz" <invalid@invalid.invalid> |
|---|---|
| Newsgroups | comp.lang.clipper.visual-objects |
| Subject | Re: First tests with Windows 10 Anniversary Update |
| Date | 2016-10-29 12:09 +0200 |
| Message-ID | <e7jat9F864uU1@mid.individual.net> (permalink) |
| References | <nuse5p$78k$1@dont-email.me> |
Hi Arne,
> Our programs have some owner drawn push buttons with gradients that now
> show very strange colors randomly changing. The reason seems to be the
> function GradientFill of the dll msimg32.dll.
I´m using Gradientfill() on a CustomControl that works as expected under
Win7,8 and 10. Because Gradientfill() fills only a small part of a CC in my
real app i made a test to see what happens when i fill a much larger CC
area.Assuming that you have all the required Defines etc. here´s the
Dispatch Code of a subclassed CC. BTW. The only difference i noticed is the
nasty flickering Win 10 produces when such a control is resizable ...
Here´s a link to my win 10 results ( GRADIENT_FILL_RECT_H and
GRADIENT_FILL_RECT_V )
http://www.rauscher-software.de/downloads/GradientW10.jpg
regards
Karl-Heinz
---------------------------------------------------
CLASS ccGradientFill INHERIT Customcontrol
-----------------------------------------------
METHOD Dispatch ( oEvent ) CLASS ccGradientFill
LOCAL struPaint IS _winPAINTSTRUCT
LOCAL struRect IS _winRECT
LOCAL DIM vert[2] IS _winTRIVERTEX
LOCAL gRect IS _winGRADIENT_RECT
LOCAL hDC, hLib, hFunc AS PTR
DO CASE
CASE oEvent:message == WM_ERASEBKGND
// not really nessecary < W10, but doesn´t help to prevent the
flickering in W10 ...
RETURN SELF:eventreturnvalue := 1L
CASE oEvent:message == WM_PAINT
hDC := BeginPaint( SELF:Handle() , @struPaint )
GetClientRect ( SELF:Handle() , @struRect )
IF ( hLib := LoadLibrary( Cast2Psz ("msimg32.dll")) ) != NULL_PTR
.AND. ;
( hFunc := GetProcAddress( hLib, String2Psz ("GradientFill")) )
!= NULL_PTR
vert[1].x := struRect.left
vert[1].y := struRect.top
vert[1].Red := 0x0000
vert[1].Green := 0x8000
vert[1].Blue := 0x8000
vert[1].Alpha := 0x0000
vert[2].x := struRect.right - struRect.left
vert[2].y := struRect.bottom - struRect.top
vert[2].Red := 0x00
vert[2].Green := 0xd000
vert[2].Blue := 0xd000
vert[2].Alpha := 0x0000
gRect.UpperLeft := 0
gRect.LowerRight := 1
PCALL( hFunc, hDC, @vert, 2, @gRect, 1, GRADIENT_FILL_RECT_H )
// or GRADIENT_FILL_RECT_V
ENDIF
IF hLib != NULL_PTR
FreeLibrary( hLib )
ENDIF
EndPaint ( SELF:handle() , @struPaint )
ENDCASE
RETURN SUPER:Dispatch ( oEvent )
Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Find similar | Unroll thread
First tests with Windows 10 Anniversary Update "Arne Ortlinghaus" <Arne.Ortlinghaus@acs.it> - 2016-10-27 10:34 +0200 Re: First tests with Windows 10 Anniversary Update "Karl-Heinz" <invalid@invalid.invalid> - 2016-10-29 12:09 +0200
csiph-web