Click here to Skip to main content
14,239,168 members
   

Mobile

 
GeneralMessage Closed Pin
22-Nov-15 21:17
memberMember 1216007522-Nov-15 21:17 
GeneralRe: software development cost Pin
Kunal Chowdhury «IN»28-Feb-16 18:51
mentorKunal Chowdhury «IN»28-Feb-16 18:51 
AnswerRe: software development cost Pin
Preston Berger14-Jun-16 5:32
memberPreston Berger14-Jun-16 5:32 
QuestionDecode QR Pin
Tirumaleswara Reddy.K20-Nov-15 21:58
memberTirumaleswara Reddy.K20-Nov-15 21:58 
QuestionI wonder how phone trace working? Pin
JOE Heart Under Blade16-Nov-15 20:29
memberJOE Heart Under Blade16-Nov-15 20:29 
AnswerRe: I wonder how phone trace working? Pin
Richard MacCutchan16-Nov-15 21:14
protectorRichard MacCutchan16-Nov-15 21:14 
GeneralRe: I wonder how phone trace working? Pin
JOE Heart Under Blade16-Nov-15 21:15
memberJOE Heart Under Blade16-Nov-15 21:15 
Question[WP8.1] How to scale a background image of a button? Pin
Dr Miroslav Stimac6-Nov-15 10:02
professionalDr Miroslav Stimac6-Nov-15 10:02 
Hello,

I am developing an app for Windows Phone 8.1 by using XALM and C# within a Windows Universal Project.
My problem is that the background images of the buttons do not correctly scale.

I want to use an image as the background of a button and the image should always scale to maximum size of the button, but keep the correct ratio (a circle shall always look like a circle and not like an ellipse!).

I tried this:
<Grid.RowDefinitions>
          <RowDefinition Height="17.3*" />
          <RowDefinition Height="4.2*" />
          <RowDefinition Height="1*" />
          <RowDefinition Height="6.025*" />
          <RowDefinition Height="4.95*" />
          <RowDefinition Height="6.025*" />
          <RowDefinition Height="6.5*" />
          <RowDefinition Height="1*" />
          <RowDefinition Height="6.5*" />
          <RowDefinition Height="30*" />
          <RowDefinition Height="8*" />
          <RowDefinition Height="8.5*" />
      </Grid.RowDefinitions>
      <Grid.ColumnDefinitions>
          <ColumnDefinition Width="12*" />
          <ColumnDefinition Width="9.5*" />
          <ColumnDefinition Width="16.5*" />
          <ColumnDefinition Width="15*" />
          <ColumnDefinition Width="16.5*" />
          <ColumnDefinition Width="9.5*" />
          <ColumnDefinition Width="1.0*" />
          <ColumnDefinition Width="10.0*" />
          <ColumnDefinition Width="1.0*" />
      </Grid.ColumnDefinitions>


      <TextBox x:Name="textBox1" Grid.Row="8" Grid.Column="1" Grid.ColumnSpan="5" TextAlignment="Center" VerticalContentAlignment="Stretch" HorizontalAlignment="Stretch" Margin="0,0,0,0" TextWrapping="Wrap" VerticalAlignment="Stretch" BorderThickness="0" />


      <Button x:Name="buttonMeasurement" Grid.Row="9" Grid.Column="2" Grid.ColumnSpan="3" Content="" HorizontalAlignment="Stretch" Margin="0,0,0,0" VerticalAlignment="Stretch" BorderThickness="0" Click="buttonMeasurement_Click" >
          <Button.Background>
              <ImageBrush ImageSource="Images/Screen3/START.png" Stretch="UniformToFill"/>
          </Button.Background>
      </Button>


But the background image of the button is cut at the top and the bottom!
It seems that there is not enough vertical space (height) for the image.

If I use
<ImageBrush ImageSource="Images/Screen3/START.png" Stretch="Uniform"/>

instead of
<ImageBrush ImageSource="Images/Screen3/START.png" Stretch="UniformToFill"/>

then the image is not cut and looks OK, but only on 16:9 devices such as Lumia 640 XL.
On 15:9 devices auch as Lumia 520 there is a distortion: a circle looks like an elipse!
The image is not correctly scaled: the aspect ratio is not perserved!

What did I wrong?

Thanks for any hints!

Best wishes,

Miroslav
Questionlost focus on form in Windows-Mobile Pin
goldsoft2-Nov-15 21:37
membergoldsoft2-Nov-15 21:37 
Answer[REPOST] lost focus on form in Windows-Mobile Pin
Richard Deeming3-Nov-15 2:14
mveRichard Deeming3-Nov-15 2:14 
QuestionHow to use printer in the universal windows 10 app in Visual Studio c# Pin
Anjani Rajdev30-Oct-15 3:20
memberAnjani Rajdev30-Oct-15 3:20 
AnswerRe: How to use printer in the universal windows 10 app in Visual Studio c# Pin
Afzaal Ahmad Zeeshan30-Oct-15 4:33
mveAfzaal Ahmad Zeeshan30-Oct-15 4:33 
GeneralIs using images for buttons in Mobile app development is a common thing? Pin
Member 1189244119-Oct-15 20:55
memberMember 1189244119-Oct-15 20:55 
GeneralRe: Is using images for buttons in Mobile app development is a common thing? Pin
Richard MacCutchan20-Oct-15 2:59
protectorRichard MacCutchan20-Oct-15 2:59 
GeneralRe: Is using images for buttons in Mobile app development is a common thing? Pin
Member 1189244120-Oct-15 19:11
memberMember 1189244120-Oct-15 19:11 
GeneralRe: Is using images for buttons in Mobile app development is a common thing? Pin
Richard MacCutchan20-Oct-15 21:28
protectorRichard MacCutchan20-Oct-15 21:28 
GeneralRe: Is using images for buttons in Mobile app development is a common thing? Pin
Richard MacCutchan20-Oct-15 21:29
protectorRichard MacCutchan20-Oct-15 21:29 
GeneralRe: Is using images for buttons in Mobile app development is a common thing? Pin
Member 138173168-May-18 22:37
memberMember 138173168-May-18 22:37 
QuestionWindows 10 mobile live tile not updating in emulator? Pin
windowsphonewinit12348-Oct-15 21:51
memberwindowsphonewinit12348-Oct-15 21:51 
QuestionDevelop windows 10 app using windows 7 and visual studio 2013 Pin
Anjani Rajdev5-Oct-15 0:11
memberAnjani Rajdev5-Oct-15 0:11 
AnswerRe: Develop windows 10 app using windows 7 and visual studio 2013 Pin
Richard MacCutchan5-Oct-15 0:50
protectorRichard MacCutchan5-Oct-15 0:50 
AnswerRe: Develop windows 10 app using windows 7 and visual studio 2013 Pin
Pavan_Pareta7-Oct-15 22:35
memberPavan_Pareta7-Oct-15 22:35 
AnswerRe: Develop windows 10 app using windows 7 and visual studio 2013 Pin
Peter_in_27807-Oct-15 22:56
professionalPeter_in_27807-Oct-15 22:56 
GeneralRe: Develop windows 10 app using windows 7 and visual studio 2013 Pin
Afzaal Ahmad Zeeshan7-Oct-15 23:03
mveAfzaal Ahmad Zeeshan7-Oct-15 23:03 
QuestionC++ mobile SDK, tips and how tos? Pin
VooDooChicken2-Oct-15 6:18
memberVooDooChicken2-Oct-15 6:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.