Author Topic: Miscellaneous snippets  (Read 16381 times)

daydreamer

  • Member
  • ****
  • Posts: 808
  • watch Chebyshev on the backside of the Moon
Re: Miscellaneous snippets
« Reply #120 on: May 19, 2019, 12:19:26 AM »
Thanks, Daydreamer. Arrayplot is Gdi, actually. Speedwise, check the Sinus plot template (attached). Re GET & PUT: There are ways to do something similar in MasmBasic, but I doubt that LordAdef is using them.
if its gdi draw chinese characters,please check in my thread if you can show a smoother solution to this problem Jochen
http://masm32.com/board/index.php?topic=7834.0
Quote from Flashdance
Nick  :  When you give up your dream, you die
*wears a flameproof asbestos suit*
MM,XMM,YMM,ZMM registers,whats next?use nonenglish 29 letter alphabet,ÅMM,ÄMM,ÖMM registers?:D

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 9469
  • Assembler is fun ;-)
    • MasmBasic
Re: Miscellaneous snippets
« Reply #121 on: May 19, 2019, 05:16:09 AM »
The text is not the problem, Gdi draws fonts OK. It is the ragged line. Below an excerpt from the plot where I added a line drawn with Gdi+, using high quality anti-aliasing. It does make a difference, but the extra quality is not overwhelming.

You must zoom in quite a lot to see a difference. On Chrome/SlimJet it's holding Control and pushing the mousewheel forward.

Btw this is line width 3; for finer lines, the difference between plain Gdi and high quality anti-aliased Gdi+ is almost negligible. On the right side of the graph, I added a comparison between 5px and 1px lines. If you zoom to 200 or 250%, the difference becomes evident. Note also how neat the Chinese text looks - it's really fine.

daydreamer

  • Member
  • ****
  • Posts: 808
  • watch Chebyshev on the backside of the Moon
Re: Miscellaneous snippets
« Reply #122 on: May 19, 2019, 06:01:06 AM »
The text is not the problem, Gdi draws fonts OK. It is the ragged line. Below an excerpt from the plot where I added a line drawn with Gdi+, using high quality anti-aliasing. It does make a difference, but the extra quality is not overwhelming.

You must zoom in quite a lot to see a difference. On Chrome/SlimJet it's holding Control and pushing the mousewheel forward.

Btw this is line width 3; for finer lines, the difference between plain Gdi and high quality anti-aliased Gdi+ is almost negligible. On the right side of the graph, I added a comparison between 5px and 1px lines. If you zoom to 200 or 250%, the difference becomes evident. Note also how neat the Chinese text looks - it's really fine.
maybe d3d can antialias better and faster with full antialias settings
Quote from Flashdance
Nick  :  When you give up your dream, you die
*wears a flameproof asbestos suit*
MM,XMM,YMM,ZMM registers,whats next?use nonenglish 29 letter alphabet,ÅMM,ÄMM,ÖMM registers?:D

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 9469
  • Assembler is fun ;-)
    • MasmBasic
Re: Miscellaneous snippets
« Reply #123 on: May 19, 2019, 06:18:16 AM »
maybe - post a demo ;-)

LiaoMi

  • Member
  • ***
  • Posts: 486
Re: Miscellaneous snippets
« Reply #124 on: May 19, 2019, 07:08:31 PM »
Hi,

I take my words back  :biggrin: It looks like its just impossible to make normal smoothing with GDI, other technologies have to deal with it.

https://software.intel.com/en-us/articles/mlaa-efficiently-moving-antialiasing-from-the-gpu-to-the-cpu
SMAA: Subpixel Morphological Antialiasing https://github.com/iryoku/smaa
Demo - https://web.archive.org/web/20121023110459/http://www.iryoku.com/mlaa/downloads/Jimenez-MLAA-DX10-v1.5.exe

Below, I gave examples showing the difference between display technologies.

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 9469
  • Assembler is fun ;-)
    • MasmBasic
Re: Miscellaneous snippets
« Reply #125 on: May 19, 2019, 08:03:31 PM »
Project upgrade failed (your source is 2007, I tried with Visual Crap 2010) 8)

daydreamer

  • Member
  • ****
  • Posts: 808
  • watch Chebyshev on the backside of the Moon
Re: Miscellaneous snippets
« Reply #126 on: May 20, 2019, 09:01:26 PM »
maybe - post a demo ;-)
docs says it doesnt antialias lines,only polys in fullscene antialias
Quote from Flashdance
Nick  :  When you give up your dream, you die
*wears a flameproof asbestos suit*
MM,XMM,YMM,ZMM registers,whats next?use nonenglish 29 letter alphabet,ÅMM,ÄMM,ÖMM registers?:D

LiaoMi

  • Member
  • ***
  • Posts: 486
Re: Miscellaneous snippets
« Reply #127 on: May 20, 2019, 10:46:18 PM »
Project upgrade failed (your source is 2007, I tried with Visual Crap 2010) 8)

Hi jj2007,

I also have no success in the visual studio 2019, I will try on another machine. The first example shows that in GDI it is not reachable, and the second example shows how ideally it should be, taking into account that another mechanism is used. The speed and processing of both techniques are completely different. I do not think it's worth puzzling over this problem  :rolleyes:

daydreamer

  • Member
  • ****
  • Posts: 808
  • watch Chebyshev on the backside of the Moon
Re: Miscellaneous snippets
« Reply #128 on: May 25, 2019, 10:34:45 PM »
Thanks, Daydreamer. Arrayplot is Gdi, actually. Speedwise, check the Sinus plot template (attached). Re GET & PUT: There are ways to do something similar in MasmBasic, but I doubt that LordAdef is using them.
you use GDI background color=bitmap? or use background color=null?
for example want to have a moving object,just redraw it together with erase few pixels behind it?

I found this direct2d vs GDI,look below at the images direct2d is smoother curves
https://docs.microsoft.com/sv-se/windows/desktop/direct2d/direct2d-overview
Quote from Flashdance
Nick  :  When you give up your dream, you die
*wears a flameproof asbestos suit*
MM,XMM,YMM,ZMM registers,whats next?use nonenglish 29 letter alphabet,ÅMM,ÄMM,ÖMM registers?:D

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 9469
  • Assembler is fun ;-)
    • MasmBasic
Re: Miscellaneous snippets
« Reply #129 on: May 25, 2019, 11:26:11 PM »
I found this direct2d vs GDI,look below at the images direct2d is smoother curves

The curves are Gdi vs D2D, not Gdi+. They write "When rendering in software, applications that use Direct2D experience substantially better rendering performance than with GDI+ and with similar visual quality." - and I bet they mean "almost the same quality".

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 9469
  • Assembler is fun ;-)
    • MasmBasic
WM_DROPFILES
« Reply #130 on: June 20, 2019, 06:15:26 PM »
GuiParas equ "Event Dropfiles demo", x1000, y20, w350, h700, cblack, b00FFFFD0h
include \masm32\MasmBasic\Res\MbGui.asm

Event DropFiles
  GfNoPaths=1                           ; optional: don't include the paths
  For_ ecx=0 To eax-1                   ; #files was returned in eax
        wPrintLine wRec$(Files$(ecx))   ; show the files in the console window
  Next
  GuiRefresh                            ; GuiText needs a WM_PAINT handler

Event Paint
  For_ ecx=0 To Files$(?)-1
        GuiText 3, ecx*20, Files$(ecx)
  Next
GuiEnd