Display text over image - windows-phone-8

I need to create a Grid with 3 columns where each of cell has a textblock over an image.
I saw this code How do we set background image of TextBlock in Windows Phone? but will I need to add a new grid for each cell?

You don't have to add a new grid for each cell. You can just add an control to the cell and then a . It will render the text over the image in each cell. Just set the Grid.Column="" for the image and textblock.

Related

LibGDX how to make a buttons size independent of image

When adding images to a TextButton in LibGDX how would I match the button to the contents of the image. Currently when I set size the image scales down to fit the button which leaves a large gap between the edge of the button and the contents of the image (See distance from green debug border to the edge of the buttons image).
I would like to be able to set the size of the button to match the content of the image so that the empty space around the image is ignored. I could crop out the empty space from the image but would have an off centered image due to the drop shadow and so would like to avoid that.
Top image shows the displayed dutton in game including the debug button border in green. Bottom image shows the source image with empty space.
TextButton.TextButtonStyle buttonStyle = new TextButton.TextButtonStyle();
buttonStyle.font = FontLoader.uiFont;
buttonStyle.up = new SpriteDrawable(new Sprite(assetManager.get(UISpriteLoader.SPRITE_UI_TAMING_BUTTON_BASE, Texture.class)));
buttonStyle.down = new SpriteDrawable(new Sprite(assetManager.get(UISpriteLoader.SPRITE_UI_TAMING_BUTTON_PRESSED, Texture.class)));
buttonStyle.over = new SpriteDrawable(new Sprite(assetManager.get(UISpriteLoader.SPRITE_UI_TAMING_BUTTON_HOVER, Texture.class)));
tameButton = new TextButton("Tame", buttonStyle);
tameButton.setPosition(1470, 1080-330-80);
tameButton.setSize(250, 80);
stage.addActor(tameButton);
Use a Ninepatch for your images. It will scale to fill the button out of the box.
I recommend you to use Skin Composer both for making the Ninepatches and for creating a Scene2d skin so you don't have to create your Styles in code.

Is it possible to draw smaller rectangle in table cell in microsoft report?

I have a table with four columns. Column 3 is about mark grade (A,B,B+,...) and I want draw rectangle around it. When I drag rectangle into table cell, it auto resize to fit the whole cell but I cannot resize it smaller.
Is it possible way to solve this problem?
Yes this can be done. While you are currently inserting a rectangle to the cell, there is nothing stopping you adding another rectangle inside this first rectangle.
Add a rectangle to the cell in your table (yellow background in the screenshot below)
Add a rectangle inside this rectangle, and set it's BorderStlye to Solid and BorderWidth to 2pt (red background in the screenshot below)
Insert a textbox showing you expression to the inner rectangle (blue background in the image below.
This will give a layout as shown
That when run will appear as follows
You can resize this items to be the size you require for your report.
Hopefully this will solve you problem - let me know if you need further assistance or if I can help further

Rounded box in SSRS

I have rectangle which act as container for other elements.
Can I somehow setup some property of rectangle to round its corners, in fact, to get rounded box.
In css it is easy, but how to do in SSRS?
Actually, it is fairly easy. I had a bunch of text boxes that a rounded corner border needed to be placed. The first thing I tried was an image control. I placed it on top of my text boxes and set it to "Send to back." It worked well in print rendering, however, in the browser rendering the HTML placed the textboxes after the image making it look horrible.
The solution was this:
Go into paint and draw a rounded corner box the size you need.
Cut the set of text boxes to surround with rounded border.
Place a rectangle control over the entire area all the text boxes covered.
Paste my text boxes onto the rectangle.
Right-Click and choose rectangle properties.
Select the Fill Tab and select "Embedded" image source.
Click Import and select your paint image(i used PNG but it shouldn't matter).
Click Ok.
Find and expand BackgroundImage on Rectangle and change BackgroundRepeat to "Clip.". Otherwise, your image is repeated.
The report should now render properly in both print and html rendering views. Unfortunately, this doesn't seem to stretch/size, so unless you can figure that one out, you will have to repeat whenever you need a different sized rounded box.
Brian
All solution I have seen use a background image inside a textbox.
But you get problems when you try to resize the textbox.
The solution is to insert a 3x3 table inside the texbox.
Insert the 3x3 table
Insert an image on each corner. They will be a quarter of a circle each. (This image is created in MS Paint or your favorite image program)
Make those 4 corners cells unresizable (Set property CanGrow to false). Make sure all the other cells have CanGrow = true if you need it
Make all the cells the same background color (same color as the image you draw).
Write your text in the middle cell.
OPTIONAL: It might also be a good idea to fuse the 3 vertical middle cells if possible. It will allow more space to write text in the cell.
This way you won't have to create new image everytime the size of your textbox change.
You would have to build an image that has a transparent center for adding your text.
All this would be more work than I would want to do just for a report.
I would stick with just the standard textboxes.

SSRS auto-fit gauges in panel

Indicator automatically extends when the row in the table will be more than one line of text. Here is an example how it looks like:
What to do to not change its size?
There is an option such "Auto-fit all gauges in panel" in Indicator properties. But I don't understand how it works and what should I do to change it in right way.
Any tips? ;)
You should put a rectangle within your table cell, and put the indicator within that.. This should ensure that the indicator size stays uniform.
Also remember to remove the rectangle borders where required.

Using box properties in HTML formatting of widgets 'content' property

I want a widget that is roughly square, the same height as the 16x16 pixel .ico widgets on Widget Row (or whatever the technical term is for that row of widgets at the bottom of the Firefox window) containing a single letter of text, centered horizontally and "middled" vertically, with control through add-on code of text and background color. Can this be HTML coded as the content property of the widget object? I've gotten the colors with a style attribute of a span around the letter, but no luck so far getting the "box properties" to kick in.
not sure what you are trying get but you can do create that with the style attribute very easily. http://jsfiddle.net/k9brL/