Click here to Skip to main content
13,251,998 members (52,090 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hi Guys

Very difficult to write this without using explicit language but i will try.
I have a WPG library, with a WFP user control in it, now all I want to do is set the background of a scrollviewer to an image and tile it

Sounds very simple doesnt it ?

When I try and set it in the designer (as in select my .bmp image saved via MS paint) it never shows up ( it does not neatly add it to a resource file (Like I am so used to with Winforms) no it inputs a url in the markup (XAML <- Always fun listening to Jessie Liberty from microsoft say it)

               <ImageBrush ImageSource="Images/diagramBG1.bmp" />

So when i run it I get the following

'Provide value on 'System.Windows.Baml2006.TypeConverterMarkupExtension' threw an exception.' Line number '12' and line position '18'.

And yes I did copy the image to the local path and directory

So What i would really like to do is! :
be able to assign the image via code and a 64 bit string or a byte array of the image

Feel like a total noob by asking somethign that is conceptually very easy (for just about everything else) but for WPF.

Thanks in Advance
Posted 24-Jan-13 3:41am
L Viljoen5.3K
Updated 24-Jan-13 3:42am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

My first question is: Have you set the bacground image's compile mode to resource in the project explorer?

If yes, then maybe WPF doesn't like bmp images. I allways use png format. Takes less space and it's lossless.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.171114.1 | Last Updated 24 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100