Print Page | Close Window

Use SVG file in Markup from resources

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=24534
Printed Date: 23 April 2025 at 10:24am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Use SVG file in Markup from resources
Posted By: KrustyKrab
Subject: Use SVG file in Markup from resources
Date 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?




Replies:
Posted By: DavidH
Date 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.



Posted By: KrustyKrab
Date Posted: 12 March 2025 at 5:21am
Unfortunately, I did not find a solution yet. I hope that this will be supported with a future Codejock update.

Thanks for the information about png and bmp resources Thumbs Up



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net