Print Page | Close Window

XAML Image from code

Printed From: Codejock Forums
Category: General
Forum Name: XAML Snippets
Forum Description: Post your XAML snippets here for everyone to enjoy :)
URL: http://forum.codejock.com/forum_posts.asp?TID=17096
Printed Date: 30 January 2025 at 6:07pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: XAML Image from code
Posted By: Steve28
Subject: XAML Image from code
Date Posted: 10 August 2010 at 2:56pm

I'm trying to load an image that is contained in a zip archive without unpacking it to a temporary location. I can load the image programmatically, does anyone know if there's a way i can set the Image Source to a bitmap/ole handle at run-time.

<Image Width="64" Height="64" Source=" - file://C:\Research\Images\Png\Explorer.png"/ >  really this will be in a zip archive



Replies:
Posted By: jpbro
Date Posted: 19 August 2010 at 2:14pm
I haven't tried it, but if you are using the MarkupLabel control to display your XAML, take a look at the .Icons.AddBitmap and .Icons.AddIcon methods. They accept a handle parameter, and a Command number for the icon. Then in the source attribute of your XAML, use the Command number of the icon that you added instead of file://...




-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6



Posted By: markr
Date Posted: 20 August 2010 at 10:25am
See the markup sample project. It uses XTPImageManager() to load images and assign them an ID. You can then reference that ID in your markup.



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