Re: Drawing electronic circuits or schematics with schemdraw Python package in a wxPython GUI

Matthias Brennwald <[email protected]> Thu, 25 Nov 2021 19:33:11 +0100
Newsgroups gmane.comp.python.wxpython
Message-ID <[email protected]>
--=-iYOB7YBfeGaDLhyls+gO
Content-Type: text/plain; charset="UTF-8"; format=flowed


On Do, Nov 25 2021 at 19:24:22 +0100, Dietmar Schwertberger 
<[email protected]> wrote:
> On 25.11.2021 09:37, [email protected] wrote:
>> At first I thought of the following approach:
>> (1) Extract the SVG bytes from the schemdraw object: bytes = 
>>  drawing.get_imagedata('svg')
>> (2) Use this with wx.svg.SVGimage.CreateFromBytes(bytes) to create 
>> the  SVGimageBase for use with wxPython
>> However, it seems wxPython version 4.1 is required for step (2), 
>> while  I am stuck with 4.0 on my machine.
> 
> Why do you want to convert to SVG first? Schemdraw get_imagedata() 
> seems to support PNG export.
> 
> Regards,
> 
> Dietmar

I was thinking that a vector graphics format would be better in view of 
different (high) DPI environments. However, PNG (or other bitmap 
formats) are not necessarily out of question if there is no good way 
with vector graphics.

How could I make use of the PNG output from schemdraw in wxPython? The 
PNG examples I found for wxPython always make use of a PNG file as the 
source for the image data.

-- 
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/BV453R.VM7VM5MEKLD22%40gmail.com.

--=-iYOB7YBfeGaDLhyls+gO
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div id=3D"geary-body" dir=3D"auto"><div><br></div></div><div id=3D"geary-q=
uote" dir=3D"auto">On Do, Nov 25 2021 at 19:24:22 +0100, Dietmar Schwertber=
ger &lt;[email protected]&gt; wrote:<br><blockquote type=3D"cite"><=
div class=3D"plaintext" style=3D"white-space: break-spaces;">On 25.11.2021 =
09:37, [email protected] wrote:
<blockquote>At first I thought of the following approach:
(1) Extract the SVG bytes from the schemdraw object: bytes =3D  drawing.get=
_imagedata('svg')
(2) Use this with wx.svg.SVGimage.CreateFromBytes(bytes) to create the  SVG=
imageBase for use with wxPython
However, it seems wxPython version 4.1 is required for step (2), while  I a=
m stuck with 4.0 on my machine.
</blockquote>
Why do you want to convert to SVG first? Schemdraw get_imagedata() seems to=
 support PNG export.

Regards,

Dietmar
</div></blockquote><span style=3D"white-space: break-spaces;"><br>I was thi=
nking that a vector graphics format would be better in view of different (h=
igh) DPI environments. However, PNG (or other bitmap formats) are not neces=
sarily out of question if there is no good way with vector graphics.</span>=
<div><span style=3D"white-space: break-spaces;"><br></span></div><div><span=
 style=3D"white-space: break-spaces;">How could I make use of the PNG outpu=
t from schemdraw in wxPython? The PNG examples I found for wxPython always =
make use of a PNG file as the source for the image data.</span></div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;wxPython-users&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:[email protected]">wxpy=
[email protected]</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/d/msgid/wxpython-users/BV453R.VM7VM5MEKLD22%40gmail.com?utm_medium=3Dema=
il&utm_source=3Dfooter">https://groups.google.com/d/msgid/wxpython-users/BV=
453R.VM7VM5MEKLD22%40gmail.com</a>.<br />

--=-iYOB7YBfeGaDLhyls+gO--