Author Topic: ModernUI_Spinner Control  (Read 1905 times)

fearless

  • Member
  • ***
  • Posts: 469
    • LetTheLightIn
Re: ModernUI_Spinner Control
« Reply #45 on: July 23, 2019, 01:22:25 AM »
For some reason in my gdiplus includes for uasm, based on the WinInc includes some of those values where no higher than 2, so SmoothingModeAntiAlias was 2 instead of 4, the InterpolationModeHighQualityBicubic was 4 (or 2 i think) instead of 7 - anyways once i changed them it all appeared more crisp and smoother, so I clearly had some wrong values in them.

I managed to fix the other issues - turns out i was using:
Code: [Select]
Invoke GdipDrawImage, pGraphicsBuffer, hImage, 0, 0And not supplying reals, just 0 for the last two parameters. When I changed it over to use I version it solved most of those weird drifting problems

Code: [Select]
Invoke GdipDrawImageI, pGraphicsBuffer, hImage, 0, 0
The other spinner problem, no 10 in the demo, which was only showing quarter of its image was down to not zeroing registers I think and maybe shifting on eax/ebx instead of rax/rbx before doing some calculations from rectangle values and image width and height, so now it works with:
Code: [Select]
    xor rax, rax
    xor rbx, rbx
    mov eax, rect.right
    shr rax, 1
    mov rbx, qwImageWidth
    shr rbx, 1
    sub rax, rbx
    .IF sqword ptr rax < 0
        mov rax, 0
    .ENDIF
    mov pt.x, eax
   
    xor rax, rax
    xor rbx, rbx
    mov eax, rect.bottom
    shr rax, 1
    mov rbx, qwImageHeight
    shr rbx, 1
    sub rax, rbx
    .IF sqword ptr rax < 0
        mov rax, 0
    .ENDIF
    mov pt.y, eax

Beforehand it was doing something like

Code: [Select]
    mov eax, rect.right
    shr eax, 1
    mov rbx, qwImageWidth
    shr ebx, 1
    sub eax, ebx
    .IF sqword ptr rax < 0
        mov eax, 0
    .ENDIF
    mov pt.x, eax

Attached is the updated exe in the zip, which i hope is working now
fearless

CM690II Case, HX1000 PSU, Asus Z97, Intel i7-4790K, Seidon 120v Cooler, 16GB DDR3, MSI GTX 980TI

My Github  Twitter

Biterider

  • Member
  • ***
  • Posts: 392
  • ObjAsm32 + ObjAsm64 = ObjAsm
    • ObjAsm
Re: ModernUI_Spinner Control
« Reply #46 on: July 23, 2019, 02:13:49 AM »
Hi fearless
It looks OK now  :thumbsup:


Biterider

fearless

  • Member
  • ***
  • Posts: 469
    • LetTheLightIn
Re: ModernUI_Spinner Control
« Reply #47 on: July 23, 2019, 02:17:40 AM »
Thanks Biterider
fearless

CM690II Case, HX1000 PSU, Asus Z97, Intel i7-4790K, Seidon 120v Cooler, 16GB DDR3, MSI GTX 980TI

My Github  Twitter

jj2007

  • Member
  • *****
  • Posts: 9802
  • Assembler is fun ;-)
    • MasmBasic
Re: ModernUI_Spinner Control
« Reply #48 on: July 23, 2019, 06:11:29 AM »
Much better, compliments :thup:

LiaoMi

  • Member
  • ****
  • Posts: 593
Re: ModernUI_Spinner Control
« Reply #49 on: July 23, 2019, 07:00:46 AM »
For some reason in my gdiplus includes for uasm, based on the WinInc includes some of those values where no higher than 2, so SmoothingModeAntiAlias was 2 instead of 4, the InterpolationModeHighQualityBicubic was 4 (or 2 i think) instead of 7 - anyways once i changed them it all appeared more crisp and smoother, so I clearly had some wrong values in them.

I managed to fix the other issues - turns out i was using:
Code: [Select]
Invoke GdipDrawImage, pGraphicsBuffer, hImage, 0, 0And not supplying reals, just 0 for the last two parameters. When I changed it over to use I version it solved most of those weird drifting problems

Code: [Select]
Invoke GdipDrawImageI, pGraphicsBuffer, hImage, 0, 0
The other spinner problem, no 10 in the demo, which was only showing quarter of its image was down to not zeroing registers I think and maybe shifting on eax/ebx instead of rax/rbx before doing some calculations from rectangle values and image width and height, so now it works with:
Code: [Select]
    xor rax, rax
    xor rbx, rbx
    mov eax, rect.right
    shr rax, 1
    mov rbx, qwImageWidth
    shr rbx, 1
    sub rax, rbx
    .IF sqword ptr rax < 0
        mov rax, 0
    .ENDIF
    mov pt.x, eax
   
    xor rax, rax
    xor rbx, rbx
    mov eax, rect.bottom
    shr rax, 1
    mov rbx, qwImageHeight
    shr rbx, 1
    sub rax, rbx
    .IF sqword ptr rax < 0
        mov rax, 0
    .ENDIF
    mov pt.y, eax

Beforehand it was doing something like

Code: [Select]
    mov eax, rect.right
    shr eax, 1
    mov rbx, qwImageWidth
    shr ebx, 1
    sub eax, ebx
    .IF sqword ptr rax < 0
        mov eax, 0
    .ENDIF
    mov pt.x, eax

Attached is the updated exe in the zip, which i hope is working now

Hi fearless,

as before, I have problems with drawing, grains are visible in the pictures, they appear as noise, then disappear and the picture is clearly visible, so an infinite number of times.