skia4delphi / skia4delphi

Skia4Delphi is a cross-platform 2D graphics API for Delphi platforms based on Google's Skia Graphics Library. It provides a comprehensive 2D API that can be used across mobile, server and desktop models to render images.
https://skia4delphi.org
MIT License
694 stars 141 forks source link

Can't find unit "Vcl.Skia" on TMS Web Core #271

Open shaunroselt opened 1 year ago

shaunroselt commented 1 year ago

I have a TMS Web Core app and every time I add an SVG to a TWebImageControl component, then it adds the Vcl.Skia unit to my uses.

How do I stop it from doing this without uninstalling Skia?

This project doesn't have Skia enabled either. Skia is disabled as can be seen here:

Delphi Skia


Does Skia even work on TMS Web Core? Why is it adding stuff to my TMS Web Core App (especially considering Skia is disabled in this project)?

shaunroselt commented 1 year ago

I'm running the latest Beta version of Skia.

viniciusfbb commented 1 year ago

I have a TMS Web Core app and every time I add an SVG to a TWebImageControl component, then it adds the Vcl.Skia unit to my uses.

Without Skia, does the TWebImageControl supports SVG?

Does Skia even work on TMS Web Core?

I guess that the answer is no.

shaunroselt commented 1 year ago

Without Skia, does the TWebImageControl support SVG?

Yes. The TWebImageControl is just a normal <img> tag.

You can see it here at the bottom: https://www.w3schools.com/html/html_images.asp

Common Image Formats

I can prove this by dynamically adding the SVG via code and it then shows and works perfectly fine:

image

But as soon as I add the SVG during design-time, then the Vcl.Skia unit keeps getting added even though I don't have Skia enabled in the project:

Delphi TMS Web Core TWebImageControl Component

shaunroselt commented 1 year ago

So maybe the question should be:

Why is it trying to use Skia even though Skia is disabled in the project?

viniciusfbb commented 1 year ago

Yes. The TWebImageControl is just a normal tag.

Ok, but my question was related to TWebImageControl.Picture in designtime. With Skia uninstalled, when you try to load an image into it, in design-time, does the svg option appear?

Skia registers the .svg codec in TPicture, so when you load an .svg in designtime the vcl system itself adds the codec unit. The same thing happens when you open a jpeg or png in Vcl's TPicture in designtime. My question is whether TMS Web Core registered an SVG codec in TPicture as well and perhaps the problem is due to encoder conflicts, which is why my first question is so important.

shaunroselt commented 1 year ago

Yes. It works if I uninstall Skia:

TMS Web Core SVG Image

TMS Web Core SVG Image


But as soon as I install Skia, then I have the issue again.

shaunroselt commented 1 year ago

My question is whether TMS Web Core registered an SVG codec in TPicture as well and perhaps the problem is due to encoder conflicts

So that might be the issue, yes.

shaunroselt commented 1 year ago

This is still an issue in Delphi 12 also.

And now with Skia being integrated. I can't use any SVG images in design-time in TMS WEB Core with the TWebImageControl, because Vcl.Skia keeps being added to my uses list.

viniciusfbb commented 11 months ago

@shaunroselt Can you report it on Quality Portal? It is not related to Skia, but the way of the TPicture works. For example, if you install another svg library like EtheaDev/SVGIconImageList you will have the same issue.

(Sorry for the delay)