Click here to Skip to main content
15,881,139 members
Please Sign up or sign in to vote.
4.00/5 (1 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)

XML
<ScrollViewer.Background>
               <ImageBrush ImageSource="Images/diagramBG1.bmp" />
           </ScrollViewer.Background>


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
Updated 24-Jan-13 2:42am
v2

1 solution

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.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900