How to automatic resize tinyMCE?

Nowadays, you should use the autoresize plugin that comes with tinyMCE. You will have to call tinyMCE like this (jQuery version): $(‘.tinymce’).tinymce({ theme : ‘advanced’, plugins : ‘autoresize’, width: ‘100%’, height: 400, autoresize_min_height: 400, autoresize_max_height: 800, }); I made the experience, that it may be helpful to manually call the resizing in the init_instance_callback to … Read more

Scale text in a view to fit?

You can use the TextUtils.EllipsizeCallback. When the text gets ellipsized this callback is done by the textview. Here you can set text size smaller than the current. EDIT : Otherwise you can use TextUtils.ellipsize this way while (mText != TextUtils.ellipsize(mText, textPaint, other params)) { textpaint.setTextSize(textpaint.getTextSize() – 1); }

Resize WPF Window and contents depening on screen resolution

The syntax Height=”{Binding SystemParameters.PrimaryScreenHeight}” provides the clue but doesn’t work as such. SystemParameters.PrimaryScreenHeight is static, hence you shall use: <Window x:Class=”MyApp.MainWindow” xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation” xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml” xmlns:tools=”clr-namespace:MyApp.Tools” Height=”{x:Static SystemParameters.PrimaryScreenHeight}” Width=”{x:Static SystemParameters.PrimaryScreenWidth}” Title=”{Binding Path=DisplayName}” WindowStartupLocation=”CenterScreen” Icon=”icon.ico” > And it would fit the whole screen. Yet, you may prefer to fit a percentage of the screen size, e.g. 90%, in … Read more

ASP.NET Image uploading with Resizing

Once the file has been saved to the server you can use code like this to resize. This code will take care of length/width ratio on the resize. public static Bitmap CreateThumbnail(string lcFilename, int lnWidth, int lnHeight) { System.Drawing.Bitmap bmpOut = null; try { Bitmap loBMP = new Bitmap(lcFilename); ImageFormat loFormat = loBMP.RawFormat; decimal lnRatio; … Read more