Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Use SVG file in Markup from resources
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Use SVG file in Markup from resources

 Post Reply Post Reply
Author
Message
KrustyKrab View Drop Down
Newbie
Newbie


Joined: 13 December 2024
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote KrustyKrab Quote  Post ReplyReply Direct Link To This Post Topic: Use SVG file in Markup from resources
    Posted: 13 December 2024 at 4:55am
Using Codejock 24.0.0 I want to use a SVG image directly in Markup code by accessing from the resources. The goal is to create a custom Markup code with different (text) elements and SVG images.

I figured out that I can use the file path to my SVG image in Markup. The following is working fine and the SVG image is displayed.
CString string = _T("<Image Width='100' Height='100' Source='C:\\myFile.svg'/>");
m_wndStatic.SetMarkupText(string);

Now I would like to use a resource ID to use my SVG file in Markup but the following does not work for me:
CString string = _T("<Image Width='100' Height='100' Source='IDR_MY_SVG'/>");
m_wndStatic.SetMarkupText(string);

What can I do to use my SVG image directly in Markup code by using a resource ID?

Back to Top
DavidH View Drop Down
Groupie
Groupie


Joined: 24 March 2007
Status: Offline
Points: 60
Post Options Post Options   Thanks (0) Thanks(0)   Quote DavidH Quote  Post ReplyReply Direct Link To This Post Posted: 17 February 2025 at 3:18pm
Did you find a solution yet?

I'm trying to get this working too, but no success so far.
It seems to work with png and bmp resources:

In source file:
CXTPMarkupStatic m_wndTitle;
m_wndTitle.SetMarkupTextEx(_T("<Image Source='res://IDC_IMAGE' VerticalAlignment='Center'/>"));

In resource (.rc) file:
IDC_IMAGE PNG  "drag32.png"


Unfortunately, nothing happens with .xaml or .svg resources.

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.064 seconds.