Dear Tk'lers,
I toyed a bit with tksvg and tk 8.7 svg support.
There are 3 parameters: -scale -dpi, -unit
I take an image created with Inkscape. In Inkscape, I configured the
sheet size as 16x16 in Pixels.
% package require tksvg
% image create photo p -file save.svg
p
% pack [label .l -image p]
% image height p
16
% image width p
16
% p configure -format "svg -scale 2"
% image height p
32
% image width p
32
This works all very well, and the visual presentation scales also well.
Now, the other parameters:
% p configure -format "svg -scale 2 -dpi 1"
Nothing happens, ok, normal, we are in pixels
% p configure -format "svg -scale 1 -dpi 1 -unit cm"
The image still has 16x16, but only a partial image (the upper 1/16
corner) is shown visually.
What is the rationale behind this ?
Shouldn't the image resize to a bigger size ?
Or is this a bug ?
Thank you,
Harald
Harald my main man
I get: % p configure -format "svg -scale 1 -unit cm"
couldn't recognize data in image file "XKBlib-16.svg"
-------- ----- ------ ------
/c:2021151016:00
ps: % p configure -format "svg -unit 3"
couldn't recognize data in image file "XKBlib-16.svg"
ps2: scale works perfectly...
On Friday, May 10, 2019 at 7:04:36 AM UTC, Harald Oehlmann wrote:
Dear Tk'lers,
I toyed a bit with tksvg and tk 8.7 svg support.
There are 3 parameters: -scale -dpi, -unit
I take an image created with Inkscape. In Inkscape, I configured the
sheet size as 16x16 in Pixels.
% package require tksvg
% image create photo p -file save.svg
p
% pack [label .l -image p]
% image height p
16
% image width p
16
% p configure -format "svg -scale 2"
% image height p
32
% image width p
32
This works all very well, and the visual presentation scales also well.
Now, the other parameters:
% p configure -format "svg -scale 2 -dpi 1"
Nothing happens, ok, normal, we are in pixels
% p configure -format "svg -scale 1 -dpi 1 -unit cm"
The image still has 16x16, but only a partial image (the upper 1/16
corner) is shown visually.
What is the rationale behind this ?
Shouldn't the image resize to a bigger size ?
Or is this a bug ?
Thank you,
Harald
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 285 |
Nodes: | 16 (2 / 14) |
Uptime: | 29:19:03 |
Calls: | 6,448 |
Files: | 12,050 |
Messages: | 5,254,561 |