Whenever I use a chart with a Line series of column series (any series other than Pie Series), I have this error:
Could not find any resources appropriate for the specified culture or
the neutral culture. Make sure
WinRTXamlToolkit.Controls.DataVisualization.Properties.Resources.resources
was correctly embedded or linked into assembly
"WinRTXamlToolkit.Controls.DataVisualization" at compile time, or that
all the satellite assemblies required are loadable and fully signed
what can be wrong here ?
here's the XAML:
<charting:Chart Name="columnChart" Grid.Row="1" Width="400" Height="400" >
<charting:Chart.Series>
<charting:ColumnSeries ItemsSource="{Binding items}"
IndependentValueBinding="{Binding Name}"
DependentValueBinding="{Binding Value}"
IsSelectionEnabled="True">
</charting:ColumnSeries>
</charting:Chart.Series>
</charting:Chart>
I had the same problem. Adding the source to my own solution did not help by itself. I did manage to fix it by changing the Build Action of the resources file to Embedded Resource.
OK
removing the references and adding again using NuGet solved the initial problem, the solution to the Column Chart in this link WinRT Xaml Toolkit Column Series Error?
Related
*** Security Sandbox Violation ***
SecurityDomain 'file:///Users/Bluebird/Desktop/Demo/Project/Level_01
/Background.png' tried to access incompatible context 'app:/project.swf'
I understand that these "security" alerts are difficult to track down and even more difficult with scant information but I thought I would ask.
I have a large Flex/AIR desktop project where the user can select images off their local drive and collage them. There are also some swfs provided which they can use as "stamps". I am getting the error below when stamps are added to the app and clicked – the stamps have eventListeners attached – but the error does not reference the stamp (swf) but instead it references the background image.
The background image is a Spark Image defined in MXML:
<s:Image id="backgroundImage" x="{renderX}" y="{renderY}"
width="{renderWidth}" height="{renderHeight}"
smooth="true" smoothingQuality="high" scaleMode="stretch"
complete="backgroundImage_completeHandler(event)" />
The complete function does nothing important. The source property for the image is defined once the user has selected a local image:
backgroundImage.source = userFile.url
I don't see anywhere to provide a loaderContextfor the Image component (one solution usually suggested for "security" errors). Also, the backgroundImage component has no eventListeners – so I am completely baffled why it is throwing an error.
I've set the Flex compiler option to -use-network = false since this is just a desktop app and that is another commonly suggested "security" fix. I am also loading the "stamp" swfs through the trick of loading them as a byteArray first – another commonly suggested "security" fix.
Can someone help me hate Flash a little less?
For a quick check and probably fix, Instead the following line:-
backgroundImage.source = userFile.url
Trying giving it the relative path to the image file instead full absolute path.
like:
backgroundImage.source = "../images/bg.png";
Also, I assume you have already provided Security.allowDomain("*") in your stamp swfs.
First of all, per the Loader documentation, if you include the swf in the installed application content there won't be any security restrictions when loading it.
Otherwise, the Image component extends SWFLoader which does have a loaderContext property. Try passing in the current domain:
new LoaderContext(ApplicationDomain.currentDomain, SecurityDomain.currentDomain)
I am developing a Selfie Cam App for Windows Phone 8, I don't want to use the PhotoCamera library and Video Brush etc... to manually get the front facing cam.
I want to use the CameraCaptureTask to show the camera. As all know better, that when we launch the CameraCaptureTask, it shows the Primery(Back) camera, but I need that when the Task launch it shows the Front Facing Cam first.
Plz help in this regards.
CameraCapture task don't have option to select front-facing camera.
you've to write your own code to Launch front-facing camera by default.
Possibilities:
CameraCaptureTask is WP8 API, and i don't think that Microsoft is going to provide any option in future with CameraCaptureTask.
But in WP8.1 (wp Store apps), there are no alternative for CameraCaptureTask yet, so in future Microsoft might come out with something similar to CameraCaptureTask which might contain option to launch front-facing camera by default.
Edit:
Capture Image/Video with exact orientation:-
If you're facing issue of image capture orientation while capturing image or recording video, you should have to rotate the VideoBrush to 90 degree. So that the recorded video/Image will be captured as you wish.
Check the code for this function.
You need to edit the XAML code where you've created the VideoBrush control.
<Canvas x:Name="CanvasLayoutRoot" Background="Transparent">
<!--Camera viewfinder >-->
<Rectangle x:Name="viewfinderRectangle"
Width="{Binding ActualHeight, ElementName=CanvasLayoutRoot}"
Height="{Binding ActualWidth, ElementName=CanvasLayoutRoot}"
RenderTransformOrigin="0.5 0.5" Margin="-144 145" >
<Rectangle.RenderTransform>
<CompositeTransform Rotation="90"/>
</Rectangle.RenderTransform>
</Rectangle>
</Canvas>
Here main thing to notice is <Rectangle.RenderTransform> part and two tags RenderTransformOrigin="0.5 0.5" and Margin="-144 145" of control.
after setting the UI, assign VideoCaptureDevice to rectangle and you're done..!!
Hope that helps..
I am trying to display a GIF file stored in a Windows Phone 8.1 (RT) application's local folder. Until now, I have tried several approaches:
Load the GIF in a WebView control. This is not a solution since I want to display the images in a FlipView control (I cannot flip to another image). Also, it is quite slow.
Get the GIF frames using the BitmapDecoder class and animate them using a storyboard.
The code is as follows:
using (var stream = await storageFile.OpenReadAsync())
{
//I don't specify the type since I would like to load other type of images also
//It doesn't make any difference if I would use "BitmapDecoder.GifDecoderId"
var decoder = await BitmapDecoder.CreateAsync(stream);
uint frameCount = decoder.FrameCount;
for (uint frameIndex = 0; frameIndex < frameCount; frameIndex++)
{
var frame = await decoder.GetFrameAsync(frameIndex);
var writableBitmap = new WriteableBitmap((int)decoder.OrientedPixelWidth,
(int)decoder.OrientedPixelHeight);
var pixelDataProvider = await frame.GetPixelDataAsync
(BitmapPixelFormat.Bgra8,
decoder.BitmapAlphaMode, new BitmapTransform(),
ExifOrientationMode.IgnoreExifOrientation,
ColorManagementMode.DoNotColorManage);
var pixelData = pixelDataProvider.DetachPixelData();
using (var pixelStream = writableBitmap.PixelBuffer.AsStream())
{
pixelStream.Write(pixelData, 0, pixelData.Length);
}
_bitmapFrames.Add(writableBitmap);
}
}
The problem is that the frames I get from the GIF image are messed up
Am I doing something wrong in this approach? What should I modify in order to get good results?
I wouldn't like to use SharpDX since it seems to be very complicated and I am a beginner.
ImageTools is available only for Silverlight
I made a very basic GifImage control that you can start from. This is a starting point, you'll have to improve it to make it more usable as a reusable control. Check it out here.
EDIT
Do you have any idea how to improve the loading speed (parallelization, etc.)?
I assume you're referring to the process of preparing the frames. From what I tested, it seems to load instantly anyway, so there shouldn't be a need for drastic performance improvements. However, if perhaps the animation has hundreds of frames, then it could be a bottleneck maybe? More testing needs to be done to assess whether or not optimisations are necessary.
I also don't think it can be paralleled easily since each frame needs to be rendered in sequence from the previous frame. My only suggestion would be to run the loading code on a background thread so the UI thread doesn't block for large images.
If I have this control as a FlipViewItem, how can I release the memory after the item is flipped away?
I'm not sure whether or not you're using MVVM or not, but anyway, here's some suggestions:
Set the Source of the GifImage to null if it's not currently visible (inspect the SelectedIndex of the flip view). Note that currently the code in my repo doesn't handle setting Source to null. Like I said before, it needs lots of improvements. You'll have to make sure that the control doesn't hold any references to the frames so that the garbage collector can free them from memory (that is, call animation.KeyFrames.Clear() to clear all references to the frames).
Use a VirtualizingStackPanel inside the flip view. This will ensure that only the previous, current, and next flip view items are created in memory. You set it like this:
<FlipView>
<FlipView.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</FlipView.ItemsPanel>
</FlipView>
I had a similar problem. I was trying to display an animated GIF loaded from an external source inside a ScrollViewer for Windows Phone 8.1 app. Since the web control takes over the events the scrolling did not work.
I used this trick: I placed the web control inside a grid and put another grid over the webcontrol. The grid over the web control was set to be the exact same size and I set the background to transparent. This way the grid receives the events and the scrolling works again.
<ScrollViewer Visibility="Visible" HorizontalAlignment="Left" VerticalAlignment="Top" Width="380">
<Grid>
<StackPanel>
<!--
Some items ...
-->
<Grid >
<WebView x:Name="animationWebView" HorizontalAlignment="Left" Height="315" Width="390" Visibility="Visible" />
<Grid Width="390" Height="315" Background="Transparent" />
</Grid>
<!--
Some other items ...
-->
</StackPanel>
</Grid>
</ScrollViewer>
I started developing a Windows 8 (Metro style)-Windows Phone 8 application that will have (between the other things) a multilayer image editor. The problem is that this thing would be pretty easy with owner draw controls...but i can't find anything like that :O
I searched everywhere, but there is not something like the OnPaint/OnDraw/OnRender/OnXXXX or things like that! Am i missing something?
Thanks to everybody!
Side Note:
For my use case I founded a workaround, a Canvas with a WritableBitmap, this way I can have a "raster" surface instead of the list of items. Other than this I use the WritableBitmapEx that wraps the WritableBitmap with all the various APIs like DrawLine, Ellipse, etc..
You are right there is no OnPaint/OnDraw/OnRender in Windows Phone App.
If you want to keep it strictly XAML the best thing you can do is make your custom control
from the Canvas object like this.
<Canvas x:Name="my_canvas">
<Rectangle Fill="Red" Width="100" Height="100" Canvas.Top="100" Canvas.Left="100" />
<Rectangle Fill="Orange" Width="100" Height="100" Canvas.Top="100" Canvas.Left="200" />
<!-- more ui elements -->
</Canvas>
You can programmatically add in items using C# by doing this (it can get really tedious if you're drawing a lot of objects... like say drawing a fine stock chart)
this.my_canvas.Children.Add(my_ui_element);
There is also Windows Phone XNA which I used for a game I have uploaded to the store. In there you will have to deal with a gaming loop and content pipeline which is not easy.
I'm trying to create an IconicTile for Windows Phone 8. I've defined with VS2012 the type of Tile Template to TemplateIconic and added a Tile Title and two images for small and medium.
If I pin my app to the start screen, I can choose between small and medium tiles like expected.
Now I want to update the IconicTile I defined in my WMAppManifest.xml. As I understand IconicTile, it needs to be updated in code and will also update the LockScreen icon and count, if I defined one. I've added a DeviceLockImageURI and this Extensions:
<Extensions>
<Extension ExtensionName="LockScreen_Notification_IconCount" ConsumerID="{111DFF24-AA15-4A96-8006-2BFF8122084F}" TaskID="_default"/>
<Extension ExtensionName="LockScreen_Notification_TextField" ConsumerID="{111DFF24-AA15-4A96-8006-2BFF8122084F}" TaskID="_default" />
</Extensions>
First question: Is this ConsumerID always the same or which ID is it?
To update the IconicTile I've defined in WMAppManifest.xml, I need to get hold of any pinned Tiles of my Application on the screen. I've read a lot of tutorials explaining how to add tiles manually from your application, but I only want to use the tile I've defined in WMAppManifest.xml. Therefore all tutorials recommended to get the current active Tile with this code:
ShellTile.ActiveTiles.FirstOrDefault();
ActiveTiles is an IEnumeration and only offers me: Equals, GetEnumerator, GetHashCode, GetType and ToString
Second question: What am I missing here? Does FirstOrDefault only work for FlipTiles or CycleTiles? I only want to use the IconicTile!
So I'm stuck at identifying the current active IconicTile on the screen, so that I can use an IconicTileData object to update the count or text of the IconicTile. What am I missing here?
For the first question:
I've seen a Tile ID when you create an IconicTile from Xml:
<wp:Tile Id="[Tile ID]" Template="IconicTile">
Maybe it is this ID? Otherwise I'll go with allways the same static ID, as there is no documentation on how to create this ID.
For the second question:
I've found the error: I was missing
using System.Linq;
This using enables access to the Linq Methods necessary to use FirstOrDefault or similar commands. I was mislead by
using System.Xml.Linq;
which is definitevly not the same Linq class ;)