LiveCode/RunRev how to adjust stack size according to display size - mobile

i am new livecode app developer and developing a mobile app which needs to be multiresolutional and
fit according to display size. but when i use the image background it displays white space if display stretches beyond image size
is there any facility In RunRev to adjust view size as relative layout in android does.

To set the rect of an image object to the rect of the window, you can use
set the rect of img "Your Image" to the rect of this cd
I'm not sure if this is sufficient. For multiple resolutions, usually I make multiple stacks. You might be able to do this:
set the rect of this stack to the screenRect
set the rect of img "Your Image" to the rect of this cd
Let me know if this solves the problem.

There's a few issues to consider here.
orientation
aspect ration
pixel density
Plan A
To handle all three of these cases with one image I would suggest a square image. Make it twice the size you need for a medium density device in the size you want to support then import it into LiveCode. Set the resizeQuality to "good" (if you set it to "best" it might be a little slow) then set the lockLoc of it to true. Now divide the width and height by 2 so you end up with an image that is displayed at half it's size. This will keep the quality reasonable on a high res display. Remember to keep anything important centered on the image because the top and sides will be cut off depending on the orientation and aspect ratio.
Next step is a resizeStack script to ensure the image is resized proportionally (this script assumes the image is square):
on resizeStack
lock screen
if the height of this card > the width of this card then
set the width of image "background" to the height of this card
set the height of image "background" to the height of this card
else
set the width of image "background" to the width of this card
set the height of image "background" to the width of this card
end if
set the loc of image "background" to the loc of this card
end resizeStack
Plan B
Use a repeating pattern and set the backPattern of the stack. Much lower memory use, however, much less flexible in terms of the type of background you can use.

When resizing fields or buttons don't forget to also change the textSize in your resizeStack handler as well.
Scaled:
put "1.25" into pScaleFactor
set the textSize of field "your field" to round(the textSize of field "your field" * pScaleFactor)
set the textHeight of field "your field" to round(the textHeight of field "your field" * pScaleFactor)
or
Exact:
if the height of this card > 640 then
set the textSize of field "your field" to "24"
set the textHeight of field "your field" to "26"
end if

Related

set max width and height in percentages of screen size for lightbox image

I am using Lightbox v2.51 by Lokesh Dhakar. Is there a way to set max height and width value according to users screen resolution? I want to have the images fill most of the screen area.
Thanks.

WPF Resize Image - Fixed with, sliding height

I have an image in WPF which I would like to enlarge to a fixed width (say 800px).
The image should stretch to this width using the original aspect ratio (so not as to distort) and the height should be scaled as necessary.
If the height is not too large for the container the top of the image should show at the top of the container. The image should then slide upwards until the bottom of the image reaches the bottom of the container via an animation (so at some point the whole image has been displayed).
Links or suggestions highly appreciated

Printing with more than 96 dpi in WPF

Let me explain the problem, I'm getting stuck in it
If I change the dpi settings from the dialog of Printing Preferences of a virtual printer like PDF Creator or any printer that allows to change this setting, and then set a breakpoint like the code below:
PrintDialog printDialog = new PrintDialog();
if ((bool)printDialog.ShowDialog().GetValueOrDefault())
{
System.Printing.PrintCapabilities capabilities = printDialog.PrintQueue.GetPrintCapabilities(printDialog.PrintTicket);
...... insert breakpoint here
}
I can see that the properties printDialog.PrintTicket.PageResolution.X; and printDialog.PrintTicket.PageResolution.Y change correctly while printDialog.PrintTicket.PageMediaSize.Width and printDialog.PrintTicket.PageMediaSize.Height don't change despite the printer resolution change... an A4 paper in portrait mode will always have PageMediaSize.Height = 1122.5196850393702 and PageMediaSize.Width = 793.70078740157476 no matter which resolution is set before ..... for WPF the unit size of these dimensions is set to 1/96th inch but when is Ok on screen because default screen resolution is 96 dpi on the other side is wrong on the printer because it has a different resolution, in other words confuting that Height and Width of the paper are read only properties if I cannot find the way to tell WPF that the unit size of the printer is not 1/96th inch but for example 1/300th inch (if on the printer I previously set 300 dpi ) there's absolutely no way to print at higher resolution than 96dpi
A last note, in my specific case I cannot use RenderTargetBitmap and then resize all to match printer's paper height and width settings because I'm printing high definition barcode images and it would cause an image rescaling that would make the barcode unreadable on final paper because i create it with the purpose to be printed with a resolution of 300dpi which without a resizing will result out of bounds because WPF is telling me the printer paper dimensions in the wrong unit size (1/96th inch) despite the real dpis prevoiusly set on printer
Hoping to have clarified enough the problem,
thanks in advance,
Dave

SSRS. Autosize font to fit textbox width

Is it possible in SSRS to set the Font Size to auto? So the text fits exactly to the width of a text box?
Simply, no.
For practical reasons, some of which I can think of:
there is a lower bound to font size so some text will never fit
height changes too so for sparse text you get vertical growth

Maintain Aspect Ratio in a Silverlight Image

Ok .. so here's the scenario. I've got a WP7 silverlight app, that loads an image from the net. Now, these images will be taken from mobile devices, so they may be in portrait or landscape mode. Certainly not a square.
Is there any way to maintain the aspect ratio when I show these in a silverlight <Image> control?
I'm ok with either of two resolutions:
That the image shows up in its correct aspect ratio within a predefined box that I've defined in xaml
Or that the image is cropped into the square
The way silverlight was built, you can set the width OR the height on the image, it will automatically max out whatever property you set and calculates the other side of the image so that it keeps the aspect-ratio.
So, just set a width on the image and center or right,left,top,bottom align it. (do not stretch it).

Resources