Recent

Author Topic: Blurry or discontinuous lines in new Windows version  (Read 9103 times)

oraculus

  • New Member
  • *
  • Posts: 23
Blurry or discontinuous lines in new Windows version
« on: November 15, 2014, 06:27:01 pm »
Hello.
When I use Windows 8 for my program, canvas like this: Tv.Canvas.line(x + x2, y + y2, x, y);  appear with blurry or discontinuous lines. However in Ubuntu and in my notebook with Windows 7, the canvas shows correctly.
Anybody know the cause of this issue?.
Thank-you

Blaazen

  • Hero Member
  • *****
  • Posts: 3237
  • POKE 54296,15
    • Eye-Candy Controls
Re: Blurry or discontinuous lines in new Windows version
« Reply #1 on: November 15, 2014, 07:30:03 pm »
Try
Code: [Select]
Canvas.AntialiasingMode:=amOff;
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

oraculus

  • New Member
  • *
  • Posts: 23
Re: Blurry or discontinuous lines in new Windows version
« Reply #2 on: November 15, 2014, 11:04:45 pm »
Many thanks Blaazen, but don't work.
I do for example:
Code: [Select]
Canvas.AntialiasingMode:=amOff;
Canvas.EllipseC(X, Y, R, R);
If I compile this with my Windows 7 notebook, the image is correct, even in Windows 8, but if I compile this in my PC with Windows 8, the image shows a blurry circle.

circular

  • Hero Member
  • *****
  • Posts: 4181
    • Personal webpage
Re: Blurry or discontinuous lines in new Windows version
« Reply #3 on: November 16, 2014, 02:30:05 am »
May be related to high DPI. What if you change the options in Windows (appearance, font zoom 100%)?
Conscience is the debugger of the mind

oraculus

  • New Member
  • *
  • Posts: 23
Re: Blurry or discontinuous lines in new Windows version
« Reply #4 on: November 16, 2014, 08:48:12 pm »
Thanks, circular, but my display don't support the change that you say, therefore I cannot know if it Works.
But the most important question is: if everybody who develop a graphic application made with Lazarus, with Windows 8/8.1 or Windows 10, must change the DPI.

circular

  • Hero Member
  • *****
  • Posts: 4181
    • Personal webpage
Re: Blurry or discontinuous lines in new Windows version
« Reply #5 on: November 16, 2014, 11:59:02 pm »
Maybe if you deactive "DPI awareness" in the project options?
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 4449
    • https://lainz.github.io/
Re: Blurry or discontinuous lines in new Windows version
« Reply #6 on: November 17, 2014, 01:15:12 am »
In fact he needs to Active DPI awareness option, so the application will not be scaled by the OS.
Changing the option maybe doesn't work immediately because Windows make a cache of the manifests. Try renaming the exe, I forget how to refresh manifests with a command line tool...
For your answer: if you want to develop High DPI awareness applications you must know how to change the DPI and test under different settings: search dpi in control panel.
And.. "I need to make my application High DPI compatible?" The answer is Yes.
« Last Edit: November 17, 2014, 01:21:23 am by 007 »

oraculus

  • New Member
  • *
  • Posts: 23
Re: Blurry or discontinuous lines in new Windows version
« Reply #7 on: November 17, 2014, 11:47:20 am »
Many thanks circular and 007.
In Windows 10 I do:
Options > Project Options > then selecting the options "Use Manifest to Enable Themes (Windows)" and "Dpi Aware application (for Vista +)"
I delete the exe and rebuild the application but the result is the same; circles and lines appear blurry, like discontinous.
By the way, with Wine in Linux Mint 17, circles and lines appear also blurry.


lainz

  • Hero Member
  • *****
  • Posts: 4449
    • https://lainz.github.io/
Re: Blurry or discontinuous lines in new Windows version
« Reply #8 on: November 17, 2014, 02:22:42 pm »
Report it in the bugtracker.

BTW you can upload a screenshot of your desktop?

oraculus

  • New Member
  • *
  • Posts: 23
Re: Blurry or discontinuous lines in new Windows version
« Reply #9 on: November 17, 2014, 03:18:07 pm »
Of course; the two images.   :)

circular

  • Hero Member
  • *****
  • Posts: 4181
    • Personal webpage
Re: Blurry or discontinuous lines in new Windows version
« Reply #10 on: November 18, 2014, 11:29:30 am »
It seems the image is stretched to a smaller size when shown. Maybe you are drawing on a TImage that is stretched?
Conscience is the debugger of the mind

Never

  • Sr. Member
  • ****
  • Posts: 409
  • OS:Win7 64bit / Lazarus 1.4
Re: Blurry or discontinuous lines in new Windows version
« Reply #11 on: November 18, 2014, 02:52:28 pm »
@oraculus
where  are you drawing on ? what is the [ Tv ] ?
Νέπε Λάζαρε λάγγεψων οξωκά ο φίλοσ'ς αραεύσε

oraculus

  • New Member
  • *
  • Posts: 23
Re: Blurry or discontinuous lines in new Windows version
« Reply #12 on: November 18, 2014, 04:25:17 pm »
Yes, Tv is a TImage.
The image size change when I change the size of the window. Therefore the TImage can be stretched, but never mind if the size is little or big, always the TImage appear blurry.
The question is: why in Windows 7 (notebook), and in Ubuntu (Linux Mint 17) the canvas are drawn in a correct way, and in Windows 8.1/10 and in Wine, are not?

lainz

  • Hero Member
  • *****
  • Posts: 4449
    • https://lainz.github.io/
Re: Blurry or discontinuous lines in new Windows version
« Reply #13 on: November 18, 2014, 06:40:51 pm »
Maybe a bug related only to Windows 8.1/10?

Try to draw directly on Form canvas.

Code: [Select]
procedure TForm1.FormPaint(Sender: TObject);
begin
  Canvas.Line(0,0,Width,Height);
end; 

circular

  • Hero Member
  • *****
  • Posts: 4181
    • Personal webpage
Re: Blurry or discontinuous lines in new Windows version
« Reply #14 on: November 18, 2014, 10:19:25 pm »
There may be something with the size of the window. If the TImage is stretched and the client size of the window is not determined properly, this might result in stretching the image.

Yes, as 007 points out, try drawing directly on the canvas, if it works, there may be a problem there with TImage. You might try TBGRAVirtualScreen instead and use CanvasBGRA instead.
Conscience is the debugger of the mind

 

TinyPortal © 2005-2018