Discussion:
Blend2d Save Option
(too old to reply)
kesavapraba
2024-11-21 02:42:29 UTC
Permalink
Dear Community,
Is there any option in Blend2d TCL TK extension to save the graphics as
pdf or svg files? Thanks in advance

--
rene
2024-11-21 09:27:30 UTC
Permalink
Hello

You can alternatively try tkpath or tko::path.
Both coming with support of pdf creation.

HTH
rene

--
kesavapraba
2024-11-21 09:37:02 UTC
Permalink
Thank you for your suggestion, Rene

--
Arjen
2024-11-27 10:00:08 UTC
Permalink
Post by kesavapraba
Dear Community,
Is there any option in Blend2d TCL TK extension to save the graphics as
pdf or svg files? Thanks in advance
--
Blend2d does have the save subcommand. See Reference Manual -Blend2d 1.3
at the Wiki page https://wiki.tcl-lang.org/page/Blend2d.

Regards,

Arjen
kesavapraba
2024-11-27 13:28:07 UTC
Permalink
Dear Mr. Arjen, Sure. Thank you for taking your time answering my
question.

--
abu
2024-11-30 15:20:38 UTC
Permalink
Hi, I'm the author of Blend2.

About your interoperability question:

Blend2d can *load* PNG, BMP, QOI files (JPG encoder is not
implemented,yet)
$sfc load mypic.png
and can also import SVG files
# create a new BL::Svgdoc object by loading an SVG files
set mysvg [BL::Svgdoc new "mySVG.svg"]
# add it to the BL:Surface $sfc
$sfc paint $mysvg ;# .. plus a lot of options
It can also import tk-images
image create photo myimage
.. fill myimage ....
$sfc readFromTkPhoto myimage
(this could be a workaround for loading unsupported image formats (GIF,
JPG, ... )


Blend2d can *save* the contents of a BL::surface as PNG, BMP, QOI, JPG
$sfc save myResult.png
or, it can export its contents in a a tk-image
image create photo myimg
$sfc writeToTkphoto myimg

Blend2d *cannot* save-as SVG or PDF; this is impossible since a
BL:Surface is nothing more than a RGBA image.

--
Tip: take a look at
https://abu-irrational.github.io/tclBlend2d-Gallery
It contains screenshots of about 90 Blend2d demos.
You can find the source code for most of these demos within the current
tclBlend2d package.
I'm going to release a new version of Blend2d plus a separate package of
demos containing the source code of all the demos (contributions are
welcome).
abu
2024-12-02 19:29:50 UTC
Permalink
Correction abut JPG files:
*Blend2d can load JPG files; but it cannot save to JPG.
Anyway, thanks to its ability to exchange read/write tk-photos, you can
save/load any raster images supported by tk-photo (thanks to extensions
like package Img).
kesavapraba
2024-12-03 07:35:45 UTC
Permalink
Thank you for your nice package and reply, Mr. Abu.

--

Loading...