Click here to Skip to main content
15,888,454 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I would like to add WriteableBitmapEx lib in my Window Store Application. I just just looked with Manage NuGet packages find and found WriteableBitmapEx and installed it. No problem.

C# project.

I checked my References and there I can see WriteableBitmapEx.WinRT. Even I was able to see in my Object Browser.
Now I wanted to use it in my code but I am unable to find using WriteableBitmapEx.WinRT

VS 2012 is giving me error, unable to find it.

What I am doing wrong? Any Idea?

Your help will be very much appriciated.

Best regards
AghaKhan
Posted
Comments
Sergey Alexandrovich Kryukov 15-Mar-13 19:05pm    
Did you add a reference to the library to your project using "Add reference"? What do you mean by "unable to find"? Where did you try to find it and how?
—SA
AghaKhan 16-Mar-13 1:34am    
It will not let me add

My code look something like this

using Windows.UI.Xaml.Controls;
using System.Collections.ObjectModel;
using GameTools;
using Windows.UI.Xaml.Media.Imaging;
using System.Threading.Tasks;
using Windows.Storage.Streams;
using System.IO;
using System.Reflection;
using Windows.Storage;
using WriteableBitmapEx.WinRT;

There is RED line under using WriteableBitmapEx.WinRT;

I am unable to make any reference to that WriteableBitmapEx.
For example I want to create an image of such type I will not able to do so.
You may create a dummy project and try to add it. You will be able to see that in your reference but you will NOT able to use it.

Thank you very much for replying back.
AghaKhan 16-Mar-13 1:55am    
I created a new blank store application.
Clicked on Manage NuGet packages…
Search for WriteableBitmapEx and found and pressed install button.
Installed on my app and now I see the green check button.
Successfully installed 'WriteableBitmapEx 1.0.7.0'.
Added reference 'WriteableBitmapEx.WinRT' to project 'App2'
Added file 'packages.config'.
Added file 'packages.config' to project 'App2'
Successfully added 'WriteableBitmapEx 1.0.7.0' to App2.
Looked in my references and I see in my Object Browser it is there. I can see the path as well.
Assembly WriteableBitmapEx.WinRT
C:\Apps\App2\packages\WriteableBitmapEx.1.0.7.0\lib\NetCore45\WriteableBitmapEx.WinRT.dll

Goto to MainPage.xaml.cs and try to add using WriteableBitmapEx name space which VS 2012 unable to find it.
I am not sure how I can write code when I don’t have any reference to the library.

Thank you for prompt reply.
Sergey Alexandrovich Kryukov 16-Mar-13 2:03am    
Thank you, it's getting more clear.
"Stranger and stranger, wonderfuller and wonderfuller..." :-)
As this is so strange, going into finer detail. What does it mean, more exactly "VS 2012 unable to find it" and "...I don't have any referenced to the library"? How "not found" was manifested, exactly? How can you say "... I don't have any..." if one line above you said that you saw this reference?
—SA
Sergey Alexandrovich Kryukov 16-Mar-13 1:37am    
Could you exactly answer my questions? I'm not asking about the code yet. You did not answer if you tried to add the reference to the project, how you tried it (if you tried at all), and what happened, exactly.
—SA

1 solution

WriteableBitmapEx is extension to WriteableBitmap. So just use as WriteableBitmap image.
It works fine

void MainPage_Loaded(object sender, RoutedEventArgs e)
{
WriteableBitmap writeableBmp = new WriteableBitmap(512, 512);
writeableBmp.Clear(Colors.White);
writeableBmp.DrawLine(1, 2, 30, 40, Colors.Green);
ImageName.Source = writeableBmp;
}
ImageName is an image inside xaml file.

That is all.
 
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