Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Scrambled Graphics in Firemonkey


This question is answered.


Permlink Replies: 2 - Last Post: Sep 8, 2016 3:20 AM Last Post By: Andre Coetzer
Andre Coetzer

Posts: 10
Registered: 6/1/08
Scrambled Graphics in Firemonkey  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 7, 2016 7:51 AM
I have an application that plots quarter degree blocks on a map using Timage stacked on each other. I then add records by drawing them on a separate layer.

The problem I have is that Firemonkey (or Windows) scrambles the Graphics, but only on some computers, and I think all the affected computers are laptops. See the following links for screenshots:
[http://i724.photobucket.com/albums/ww241/BushSnake/GraphicsError_1.jpg]
[http://i724.photobucket.com/albums/ww241/BushSnake/GraphicsError2_1.jpg]

The correct image should look like this:
[http://i724.photobucket.com/albums/ww241/BushSnake/GraphicsError_Correct.jpg]

On laptops this scrambling may take 3 repaints of the layers, but sometimes (on exactly the same code) it happens after 1 or two times. While it is inconsistent in exactly how many repaints it takes, it is guaranteed to happen after no more than 3 paints.

So I have come to the conclusion that it must be a Graphics driver issue. I have a NVidia Geforce 950M on my laptop (Asus NJ551 with Windows 10), but if I understand the code correctly I am using the Windows Direct2D acceleration so the Nvidia drivers shouldn't affect things?

I set the following flag by default: GlobalUseDX10Software := true; //Use DirectX to generate graphics

I would prefer the Windows acceleration as my users may not all have a graphics card installed, but even if I set GlobalUseDX10Software to false I get the same issue. I friend using a HP laptop (not sure of the model but running Windows 8) does not experience the issue, yet another friend with a brand new HP laptop (low spec but with Windows 10) is also experiencing the issue.

Can someone please help out here? I am out of ideas, and I'm not even sure what to Google. Is it Windows 10, is it the Graphics driver, etc? Is there a way I can force my laptop to use the Graphics card for testing? While this will not help other users without proper graphics cards, it may help isolate the issue.

Any advice is appreciated!

(I am using Delphi XE8)
Eli M

Posts: 1,346
Registered: 11/9/13
Re: Scrambled Graphics in Firemonkey
Correct
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 7, 2016 8:11 AM   in response to: Andre Coetzer in response to: Andre Coetzer
There is:

FMX.Types.GlobalUseGPUCanvas := True;

But also..

GlobalUseDirect2D Boolean variable that specifies whether to use hardware accelerated Direct2D by default.
GlobalUseDX Determines whether FireMonkey renders 2D forms using DirectX for hardware acceleration (True) or using the Graphics Device Interface (False) when your application runs on Windows.
GlobalUseDX10 (deprecated) Boolean variable that specifies whether to use hardware accelerated DirectX10 by default.
GlobalUseDX10Software (deprecated) Boolean variable that specifies whether to use hardware accelerated DirectX10 and Direct2D software by default.
GlobalUseDXInDX9Mode
GlobalUseDXSoftware
GlobalUseGDIPlusClearType A Boolean variable that affects only text rendering using the GDI+ canvas.
GlobalUseGPUCanvas Boolean variable that specifies whether to use the GPU (graphics processing unit) canvas for rendering graphics and text.
GlobalUseHWEffects (deprecated) Boolean variable that specifies whether to use hardware-accelerated effects whenever possible.

http://docwiki.embarcadero.com/Libraries/Berlin/en/FMX.Types
Andre Coetzer

Posts: 10
Registered: 6/1/08
Re: Scrambled Graphics in Firemonkey  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 8, 2016 3:20 AM   in response to: Andre Coetzer in response to: Andre Coetzer
Brilliant! Thanks.

I now have GlobalUseDXSoftware instead of GlobalUseDX10Software set as true.

It seems to have sorted out my issue, and this change came when moving from XE5 to XE8
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02