Background image gets cut off, even though form and image size match - vb.net

I am trying to create a Ludo game using Windows Forms.
I have set the background to be the image of a ludo board, where both the image and the window have the same size (960x960). I cannot use the image stretch feature, as it will mess with the button positions on my Form.
The Form has the bottom and the right side of the background image trimmed off, even though the Form matches the size of the background image.

The Size of the form is the outer dimensions. You should set the ClientSize of your form to the Size of the Image, which you can do in code. That way, the image and form will look correct no matter what window chrome is or isn't present.

Related

How do you size a button to an image in the xcode IDE?

Every week I get some image updates from our graphic designer and often the sizes change. I am now bored of manually working out the size of the image and setting the button size to suit - a process I must follow to ensure the image is displayed at it's natural size for best quality.
Surely there must be a way in xcode to tell it to size the button to suit the background image?
Select the element in the storyboard and under the editor menu, you can select "size to fit content".

Vb.Net Label always centered

I'm using vb.net to make a screen saver.
I want my label where the text shows to always be centered no matter what screen size it is.
is there a way to get the screen resolution of the current monitor?
if i can get that then i can calculate the middle and set my label there.
Stretch the label to the whole width of the form and dock/anchor to left and right side within the label parameters. This will center your label whatever the size of the form.

live tiles in Windows Phone and Grids

I'm trying to create a live tile for my application, using a user control.
The user control contains a grid, an image and a rectangle filled with color.
Now here comes the funny part.
I want the rectangle to act as a background for the tile's title, and the image to fill the rest of the tile. And i said to myself, well, lets put some rows in that grid and set the like you usually set them in a WPF/SL application.
I then write the entire thing in a WBM and save it to isostore.
The problem is, the parser seems to ignore the presence of grid's rows. regardless of what I try, the rectangle is not shown, and the image covers the full tile, when it should only cover the first row. It is as if the grid didn't even existed.
Another funny aspect is that it doesn't matter if I use rows or columns, the result is the same.
Any ideas?
Are you using the following method?
Dynamic LiveTile - adding background image?
I recently implemented a Live Tile using a Grid with Rows and Columns for layout of some TextBlocks. I encountered similar challenges, so I placed the control that I was using for my Live Tile on a blank page in my app to better see what was happening. Does the control render correctly when displayed on a page (versus being rendered to a WriteableBitmap)?
Another idea. Instead of trying to position the Rectangle relative to the tile's Title, why not leave the Title property blank and put the same text in a TextBlock within the user control?
If you are careful about the font and positioning of the TextBlock, the text on the resulting background image can appear indistinguishable from text displayed from the Title property. I decided to follow this strategy myself. I found the font information in the following answer:
Font size and family for a tile's title
Otherwise, could you post an example of the XAML you are using?

UIButton: Image stretched when clicking

I am using EGOImageButton to handle the asynchronous download of image. I've set the contentMode to Aspect Fit using uibutton.imageView.contentMode rather than uibutton.contentMode because it doesn't work on iPhone so I used the former. The image inside the button stretched to the size of the button when I clicked on it. What is the solution to prevent it from stretched?
Pleaase help

Controls change place and form size changes

I have designed a form in VB.NET. At design time I have placed two buttons on it.
When I run it, the form size looks smaller and the buttons I have placed at the bottom are not visible. Also the alignment of the text and picture box is also different from what I set at design time.
Computer at which I am running the form is using a different resolution.
change the properties (F4) of the buttons: in ANCHOR put Bottom, Right
your buttons will be tied to the bottom and the right of the screen, instead of to the top, left, which is the default.
Grab the screen size at runtime with
Dim screen as System.Windows.Forms.Screen = System.Windows.Forms.Screen.PrimaryScreen
and using a scale factor depending on the current size (in design), scale the window to match. Check the coordinates of the buttons by hand to make sure they are not outside of the visible portion of the window.
You may not have to leave this feature in if you can debug it to the point that you know the exact resolution that you need.