Default Height of ProgressIndicator - windows-phone-8

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)

Related

HTML Image Sizing and Variables

I'm using an application called iDashboards, and in it there is a feature I can add called a ViFrame that takes very limited HTML to create a custom frame.
My knowledge of HTML is already pretty limited and with no output feedback, it's hard to use trial and error as a tactic.
I'm trying to display an image. The image changes dependent on the person that's selected in the app. The selection is taken care of by itself, but the problem is that the size of the pictures vary. I'm trying to display the image so that it has a definite height and a scaled width.
Displays the full size image. The HEIGHT element doesn't seem to constrain anything. If I add a WIDTH tag it works but the scaling would be messed up. Is there any way to do what I want?
The way I see it, I have two options I can think of:
1. Make every image in the library a square and then specify square dimensions so no distortion
2. Somehow retrieve the original height and width into variables in HTML and specify both tags with height being constant and width being an expression of the ratio between height and width. None of which I know is even possible. Is it? I don't think it allows tags either to go into JavaScript.
Sorry about my very basic knowledge in HTML, be gentle.
Are you using one object and changing the image or using many images and changing which one is displayed? Any way you could try to use width:YOUR_VALUE_HERE; height:auto in your css document, which should keep them all in the same ratio.
Set a particular class on the IMG tag:
<img class='constrained_img' src='/path/to/img.png'>
In your CSS/Stylesheet:
.constrained_img {
max-width:100px;
max-height:100px;
}
That should keep your height and width to no larger than 100px in this case. Any further work you'd need to do server-side processing (a la PHP's getimagesize()), or use a 3rd-party library (I've used Joseph Lencioni's SLIR to good effect), or muck around with JavaScript (which isn't impossible, but off the top of my head I'm not sure how I'd go about it).

Unable to set canvas height AngularJS

So I have a canvas element and I want to draw a chart using Angular library. I manage to draw it but the problem is that the canvas element does not take the height of the containing div, it takes a random height. Has anybody had this problem before ? I also used the resize() method from the ChartJs library (http://www.chartjs.org/docs/) but it does not seem to work. Does anybody have an idea ?
Thanks in advance!
Try changing the default values.
// Boolean - whether or not the chart should be responsive and resize when the browser does.
responsive: true,
// Boolean - whether to maintain the starting aspect ratio or not when responsive, if set to false, will take up entire container
maintainAspectRatio: false
Read more at : http://www.chartjs.org/docs/#chart-configuration-global-configuration

Qt - How to make QTextBrowser resize to contents (vertical layout)

I have a QTextBrowser object in my dialog which will have HTML written to it. It is in a vertical layout with several other objects. I have the vertical size policy currently set to MinimumExpanding for this QTextbrowser. The problem is if the HTML written to the browser ends up taller than the QTextBrowser's minimum set height, its height stays the same and it instead makes me scroll down through the browser to see all the data, where I would like it instead to show all the data at once. I have tried changing around the size policies for the QTextBrowser and the layout it is in, but nothing I have tried has worked. Is there a way to do this that I am overlooking?
QTextBrowser *m_text=new QTextBrowser;
m_text->setFixedHeight(m_text->document()->size().height());
wish to help you.
If you know how many lines you are going to add then you can work out a height and then set that height.
int number_of_lines; // If you can get this value from somewhere this should work
// Get the height of the font being used
QFontMetrics font_metrics(ui->text_browser->font());
int font_height = font_metrics.height();
// Get the height by multiplying number of lines by font height, Maybe add to this a bit for a slight margin?
int height = font_height * number_of_lines;
// Set the height to the text broswer
ui->text_browser->setMinimumHeight(height);
ui->text_browser->setMaximumHeight(height);

How to get the CSS width of a mobile device in ASP.NET MVC?

In ASP.NET MVC, how do I get the width of the screen in terms of css pixels? I'm on a Nexus 5, and if I do Request.Browser.ScreenPixelsWidth, it gives me the width in terms of the pixel density (that is 1080), but what I am trying to get is the CSS width, should be more like 480px.
One solution is to simply use JQuery's Window Width - $(window).width() - populate that in to the hiddenfield and you can get it on the server side in FormCollection.
You're right! The code you're using will always provide you with the Screen's pixels. That are counted to be 1080.
To get the CSS values, you can use JavaScript instead!
You cannot read the values on run time. Because ASP.NET don't deal in that!
I can give you a simple suggestion:
Try this:
var wid = screen.width;
Now you can write it in the document!

how to get scaled height and width?

I have a s:Group with few fixed size components in it, these are lets suppose 200x300, 300x150 etc
Now if i resize s:Group with resizeMode=Scale, (scale down). and try to read the scaled down size of these child components but they still has the same old height and width.
how can i get width and height after scaling down the parent group?
Thanks
Try myComponent.transform.pixelBounds.width. That should give you an actual measured width wrt the visible X-Axis. If you are rotating, but you want the scale along X-Axis wrt the component, see this post on obtaining the scaling of an object.
Hey there :]
At first i thought it would be an easy task to get the width and height. But when i tried it, none of explicitWidth and measuredWidth worked, when resizeMode is set to "scale" of the s:Group.
So i found a way but i'm not sure if it's the best solution:
write this in your script tag:
import mx.core.mx_internal;
use namespace mx_internal;
then if you have
Group id="group" resizeMode="scale"
and a s:Button id="myButton" inside it
in order to get the myButton width for example, just compute group.$scaleX * myButton.width
Hope this will work.
all the best,
blz