I've loaded some SVG icons into my .fl file. However, when the .fl file
is converted, the .svg icons are turned into RGB images. Is there a way
to keep them as SVG so that they will scale properly?
Tha Data Node type also improved quite a bit. You can choose if you want your data to be stored as text, binary, or zlib compressed. If you like, you can use Fl_PNG_Image("myImage", binaryData, binaryDataSze); to read an image that way instead of using the "Image" fields.
As options, I get:
Scale - Width/Height set to 0,0
Storage - compressed: ticked
- bind to widget: off
No inactive image options.
BTW... have you thought of adding a version switch to fluid? So
it becomes easier to know if I am using the same version as yours?
-- Gonzalo Garramuño ggar...@gmail.com
BUT: It doesn't rescale when I resize the widget. So I guess I do still need a resize() method to handle that still?
Yes. I get the options and I added the image, but the output is an Fl_RGB_Image() not an Fl_SVG_Image() without having touched any of the options. I am using a pretty recent branch on Linux:
Scale - Width/Height set to 0,0
Storage - compressed: ticked
- bind to widget: off
BTW... have you thought of adding a version switch to fluid? So it becomes easier to know if I am using the same version as yours?
BUT: It doesn't rescale when I resize the widget. So I guess I do still need a resize() method to handle that still?
Ian MacArthur schrieb am Donnerstag, 18. April 2024 um 13:52:14 UTC+2:
BUT: It doesn't rescale when I resize the widget. So I guess I do still need a resize() method to handle that still?
D:\a\mrv2\mrv2\BUILD-Msys-amd64\Release\mrv2\src\mrv2-build\lib\mrvWidgets\mrViewer.cxx(1529): error C2026: string too big, trailing characters truncated
I am attaching the .svg that I think is the issue.
-- Gonzalo Garramuño ggar...@gmail.com
Ian MacArthur schrieb am Donnerstag, 18. April 2024 um 13:52:14 UTC+2:
BUT: It doesn't rescale when I resize the widget. So I guess I do still need a resize() method to handle that still?
I tried it and it works, but on Windows, with a certain .svg I got:
D:\a\mrv2\mrv2\BUILD-Msys-amd64\Release\mrv2\src\mrv2-build\lib\mrvWidgets\mrViewer.cxx(1529): error C2026: string too big, trailing characters truncated
I am attaching the .svg that I think is the issue.
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/065b5d10-0ce6-43ea-ab16-a8ed0dc64519n%40googlegroups.com.
On Thursday 18 April 2024 at 21:09:51 UTC+1 Gonzalo wrote:Ian MacArthur schrieb am Donnerstag, 18. April 2024 um 13:52:14 UTC+2:
BUT: It doesn't rescale when I resize the widget. So I guess I do still need a resize() method to handle that still?
I tried it and it works, but on Windows, with a certain .svg I got:
D:\a\mrv2\mrv2\BUILD-Msys-amd64\Release\mrv2\src\mrv2-build\lib\mrvWidgets\mrViewer.cxx(1529): error C2026: string too big, trailing characters truncated
I am attaching the .svg that I think is the issue.
Hmm, just dropped that SVG file into my little fluid test, and it seems to work OK. Is it possibly a different image that is causing the issue?(I got a grey image showing a white outline, with a drop-shadow, of a stylised hand wiping a cloth over the surface; which seems like a credible image for a "scrub" icon, so I assume that is working OK.)
<quote>Before adjacent strings get concatenated, a string can't be longer than 16380 single-byte characters.A Unicode string of about one half this length would also generate this error.</quote>The solution apparently is to dice the string up into separate quoted chunks, i.e. instead of doing :-"this is a \very long \string"We need to do :-"this is a ""very long ""string"
So, as a possible workaround, I tried storing the SVG file in "compressed" form in fluid, as Matt had suggested. That certainly makes it small enough (down from approx. 20K text to approx. 7K) but I can't then seem to get Fl_SVG_Image to load it, so... One for Matt maybe? As I am out of ideas now:
int uncompressed_size = AppLicense_size;
unsigned char *AppLicenseUncompressed = (unsigned char *)::malloc(uncompressed_size);
if (uncompress(AppLicenseUncompressed, &uncompressed_size, AppLicense, sizeof(AppLicense)) != Z_OK) {
/* error */
}