Jump to content

Export SVG in Shape of Curve in Designer


Recommended Posts

I'm trying to export a shape as a SVG. I only want the shape, but it exports with the (transparent) background, essentially creating a rectangular SVG. More specifically, in the image below, I only want the white shape, but the entire blue rectangle exports. How can I export the shape only? Thanks.

Screenshot 2024-09-29 174806.png

Link to comment
Share on other sites

Welcome to the Affinity forums.

It would help to have the screenshot show the Layers panel. And to see your Export settings.

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
    Laptop 2: Windows 11 Pro 24H2,  16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU
iPad:  iPad Pro M1, 12.9": iPadOS 18.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sequoia 15.0.1

Link to comment
Share on other sites

30 minutes ago, George-Frazee said:

I'm not following what the issue is. You say it's exporting the "entire blue rectangle," are you saying it's filling in the background in some way?

Sorry. I mean the full SVG is in the shape of a rectangle. I want to add it to a web project so that when the white part is hovered, an action happens, but the action occurs when I hover anywhere within the blue square.

Link to comment
Share on other sites

47 minutes ago, turt1eback said:

Sorry. I mean the full SVG is in the shape of a rectangle. I want to add it to a web project so that when the white part is hovered, an action happens, but the action occurs when I hover anywhere within the blue square.

I see. I don't think this is an issue with Affinity or exporting, but how SVGs work by default in browsers on hover. This better may be better asked (or searched for) on Stack Overflow or one of Reddit's web design subs.

Just on a quick search myself, I believe CSS pointer-events might be what you're looking for (they do seem widely supported), but I don't know your project and I've mostly not needed to alter the default behavior for SVGs I use. Here's the link that pointed me in that direction.

  • M1 Macbook Pro
  • 16gb RAM
  • Sonoma 14.5
  • Affinity Designer 2.5.6
Link to comment
Share on other sites

5 hours ago, turt1eback said:

I want to add it to a web project so that when the white part is hovered,

I'm not very familiar with website programming, but if I remember correctly, a coordinate area needs to be designated for point & click actions.
But as I said, I'm not really familiar with website programming.

MAC mini M4 | MacOS Sequoia 15.1.1 | 16 GB RAM | 256 GB SSD 
AMD Ryzen 7 5700X | INTEL Arc A770 LE 16 GB  | 32 GB DDR4 3200MHz | Windows 11 Pro 24H2 (26100.2161)

Affinity Suite V 2.5.6 & Beta 2.6 (latest)
Interested in a free (selfhosted) PDF Solution? Have a look at Stirling PDF

Ferengi Acquisition Rule No. 49: “A deal is a deal is a deal.”

Link to comment
Share on other sites

Try this approach

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" viewBox="0 0 1697 2232" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
    <path id="blob" d="M541.264,850.287c41.323,-202.184 145.242,-308.39 307.174,-325.642c18.93,-100.251 207.323,-219.331 443.611,-343.733c71.341,276.327 -44.199,404.108 -286.444,431.174c-162.818,204.228 -128.652,290.266 150.76,229.156c47.238,-58.628 94.476,-83.087 141.715,-69.35l-12.061,69.35c118.59,524.106 112.468,991.114 -437.582,1209.1c-370.829,-314.857 -505.212,-707.297 -361.447,-1191.01l54.274,-9.046Z" />
<!--style="fill:#00f;" Delete this from path above and use css style for the base colour and the hover effect--> 
<style>
#blob{fill:#00f;}
#blob:hover{fill:#f00;}
</style>
</svg>

 

Microsoft Windows 11 Home, Intel i7-1360P 2.20 GHz, 32 GB RAM, 1TB SSD, Intel Iris Xe
Affinity Photo - 24/05/20, Affinity Publisher - 06/12/20, KTM Superduke - 27/09/10

Link to comment
Share on other sites

6 hours ago, David in Яuislip said:

Try this approach

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" viewBox="0 0 1697 2232" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
    <path id="blob" d="M541.264,850.287c41.323,-202.184 145.242,-308.39 307.174,-325.642c18.93,-100.251 207.323,-219.331 443.611,-343.733c71.341,276.327 -44.199,404.108 -286.444,431.174c-162.818,204.228 -128.652,290.266 150.76,229.156c47.238,-58.628 94.476,-83.087 141.715,-69.35l-12.061,69.35c118.59,524.106 112.468,991.114 -437.582,1209.1c-370.829,-314.857 -505.212,-707.297 -361.447,-1191.01l54.274,-9.046Z" />
<!--style="fill:#00f;" Delete this from path above and use css style for the base colour and the hover effect--> 
<style>
#blob{fill:#00f;}
#blob:hover{fill:#f00;}
</style>
</svg>

 

I think this is the best answer I have. I'll see what I can do with it. Thanks!

Link to comment
Share on other sites

12 hours ago, George-Frazee said:

I see. I don't think this is an issue with Affinity or exporting, but how SVGs work by default in browsers on hover. This better may be better asked (or searched for) on Stack Overflow or one of Reddit's web design subs.

Just on a quick search myself, I believe CSS pointer-events might be what you're looking for (they do seem widely supported), but I don't know your project and I've mostly not needed to alter the default behavior for SVGs I use. Here's the link that pointed me in that direction.

Thanks for the suggestion, but SVGs actually can work the way I want in browser. I don't know the root of the problem here. Maybe Affinity simply cannot fix this for me.

Link to comment
Share on other sites

7 hours ago, Komatös said:

I'm not very familiar with website programming, but if I remember correctly, a coordinate area needs to be designated for point & click actions.
But as I said, I'm not really familiar with website programming.

Not exactly, but thanks for the response.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.