How to set orientation of StackPanel dynamically? - windows-phone-8

I am trying to set orientation of StackPanel but following is giving me error, it says orientation does not have Vertical definition. What is the true way to set orientation of StackPanel to vertical dynamically?
StackPanel firstPanel = new StackPanel();
firstPanel.Orientation = Orientation.Vertical;

Did you try setting it through XAML? or have a look at this:
Stackpanel Orientation

Related

libgdx selectbox fit content size

I try to create a selectbox that adapts its width to its content. The JavaDoc states: The preferred size of the select box is determined by the maximum text bounds of the items and the size of the SelectBox.SelectBoxStyle.background., so it should happen automatically.
If I add the selectbox it doesn't show any content and has only the minimal size of the 9Patch used for the background. The text is only visible if I set the width manually.
Do I have to enable this functionality somehow?
I solved it.
After adding the items you have to call pack()
SelectBox<String> sb = new SelectBox<>(skin);
sb.setItems("Hello World", "FooBarBaz", "FizzBuzz");
sb.pack();
stage.addActor(sb);

Default Height of ProgressIndicator

I simply just need to find a way to determine the height of ProgressIndicator in my WP8 Silverlight solution. I know how to set the height, but I would just like to retrieve the height. This would be done in C#.
Use the ActualHeight property to retrieve the height of your control:
var height = this.ProgressIndicator.ActualHeight;
Note that the property will be filled only after the page has finished loading (more precisely, after the layout is computed)

FullScreen button not working - as3

In my application, I am keeping so much of container with components. Now I have to create Fullscreen button for VideoDisplay. I tried some what like the followings
systemManager.stage.displayState = StageDisplayState.FULL_SCREEN;
And
this.stage.addChild(videoDisplay);
this.stage.displayState = StageDisplayState.FULL_SCREEN;
videoDisplay.width = stage.width;
videoDisplay.height = stage.height;
But no use.
Is any other way is there to do it?
If your app is going to fullscreen but your video doesn't then you should probably resize it using size of your full screen:
videoDisplay.width = stage.fullScreenWidth;
videoDisplay.height = stage.fullScreenHeight;
But since your video will probably deform when adjusting to different screen dimensions (3:4, 9:16 etc) you should resize only one side and adjust the other like this:
videoDisplay.width = stage.fullScreenWidth;
videoDisplay.scaleY = videoDisplay.scaleX;
Add the videodisplay object in a group and on fullscreen button click remove the video display from group and increase the group height and width according to screen resolution.
Then add the videodispaly object to the same group and set all the property like height = 100% width = 100% , etc
If its not working use videoplayer instead of videodisplay

Flash Pro cc why is the stage width and height on my phone, set as the one inside Flash pro?

I am having problem setting the stage height and width for the app i am developing.
I need to set the height and width as for the screen of the device it is on. So i do stage.fullScreenHeight and stage.fullScreenWidth.
But i just realized that the fullScreenHeight and width it is setting is the size for the stage inside flash pro cc under properties(the stage size).
And i am not able to make the stage width and height according to the phone's. Even if i do Capabilities.screenResolutionX; or stage.stageHeight. All of them set to either the size of the image, or the stage inside flash pro, but none is according to the device.
Edit:
E.g. var button = Button = new Button();
button.width = stage.stageWidth;
button.height = Button.width/stage.stageWidth * Button.height;
Try stage.scaleMode = StageScaleMode.NO_SCALE
or unchecking "full screen" checkbox in your Air settings

bitmapData's dimensions (width and height)

I'm new to flex and I have a question concerning bitmapData and its width and height.
Normally you set up bitmapData like this in AS3:
var bd:BitmapData = new BitmapData(100, 100, true, 0x00000000);
var bm:Bitmap = new Bitmap(bd);
But in Flex embedding an an image works like this:
[Embed(source="../../../../../assets/sprites/asteroids/asteroid_32_full.gif")]
public static const Asteroid1:Class;
var imageBM:Bitmap = new Library.Asteroid1();
When using the bitmapData (e.g. imageBM.bitmapData) I don't have to set up width and height any more. Does the Flash player know the width and height of a bitmapData automatically even when NOT setting up the bitmapData's width and height? I'm totally unaware about this topic because I don't know whether the Flash player always knows the dimensions of a bitmapData. Could this cause problems when not setting up the dimensions of a bitmapData?
If you're generating a BitmapData object from scratch, you have to set the width and height.
If it's being generated automatically via image import, you don't. It's set under the covers by the image import process.