Please note: If you find any post DOES NOT contain required amount of explanation, please do comment them with a request for more information. I will update as soon as I can attend to it. Also you can contact me with a link to the post.


Friday, April 24, 2015

iPhone Launch Screen Sizes

iPhone Portrait iOS 8

Retina HT 5.5 = 1242 X 2208
Retna HD 4.7 = 750 X 1134

iPhone Landscape iOS 8

Retina HD 5.5  2208 X 1242

iPhone Portrait iOS 7,8

2X 640 X 960
Retina 4 640 x 1136

iPad Portrate iOS 7,8

1x 768 X 1024
2x 1536 X 2048

iPad Landscape iOS 7,8

1x 1024 X 768
2X 2048 X 1536

iPhone Portrait iOS 5,6

1x 320 X 480
2x 640 X 960
Retina 4 640 X 1136

iPad POrtrait (Without Status Bar) iOS 5,6

1x 768 X 1004
2X 1536 X 2008

iPad Portrait iOS 5,6

1X 768 X 1024
2x 1536 X 2048

iPad Landscape (Without Status Bar) iOS 5,6

1X 1024 X 748
2X 2048 X 1496

iPad Landscapd iOS 5,6

1x 1024 X 768
2X 2048 X 1536

Wednesday, September 19, 2012

How to crop and compress an bitmap file and load it as a Meta File

    Bitmap croppedImage = bitmap.Clone(new Rectangle(0, top, bitmap.Width, limit - top), bitmap.PixelFormat);
    System.Drawing.Image cha = image;
    Graphics g = null;                                    
    ImageCodecInfo imageCodecInfo = null;
    System.Drawing.Imaging.Encoder encoder;
    EncoderParameter encoderParameter;
    EncoderParameters encoderParameters;
    ImageCodecInfo[] encoders;
    encoders = ImageCodecInfo.GetImageEncoders();
    for (int j = 0; j < encoders.Length; ++j)
        if (encoders[j].MimeType == "image/tiff")
            imageCodecInfo = encoders[j];
    encoder = System.Drawing.Imaging.Encoder.Compression;
    encoderParameters = new EncoderParameters(1);
    encoderParameter = new EncoderParameter(encoder, (long)EncoderValue.CompressionLZW);
    encoderParameters.Param[0] = encoderParameter;
    string path = this.TempFileName("tif");
    croppedImage.Save(path, imageCodecInfo, encoderParameters);
    System.Drawing.Image m = Metafile.FromFile(path);

Saturday, December 17, 2011

How to validate a number between 0-24 with Java Scripts

<%@ Page Language="C#" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <script language="javascript" type="text/javascript">
        function checkIt(obj, evt) {
            evt = (evt) ? evt : window.event
            var charCode = (evt.which) ? evt.which : evt.keyCode
            if ((charCode < 45 || charCode > 57) && charCode != 8 && charCode != 37 && charCode != 39) {
                alert("This field accepts numbers only")
                return false
            }
            var t = (charCode / 1) - 48;
            var v = obj.value + t;
            var value = v / 1;
            if(value > 24){ 
                alert("Number should be less than 24");
                return false;
            }
            return true
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:TextBox runat="server" ID="txtNumber" onKeyPress='javascript:return checkIt(this, event)' />
    </div>
    </form>
</body>
</html>

Wednesday, December 14, 2011

How to retain the password in a postback

<%@ Page Language="C#" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Test Page</title>
    <script runat="server">
        public string Password
        {
            get { return ViewState["Password"as string; }
            set { this.ViewState["Password"] = value; }
        }
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            if (this.IsPostBack)
            {
                if (!string.IsNullOrEmpty(this.txtPassword.Text))
                    this.Password = this.txtPassword.Text;
                this.txtPassword.Attributes.Add("value"this.Password ?? string.Empty);
            }
        }
    </script>
</head>
<body>
    <form  id="aspNetForm" runat="server">
        UserName: <asp:TextBox runat="server" ID="txtName" />
        Password: <asp:TextBox runat="server" ID="txtPassword" TextMode="Password" />
        <hr />
        <asp:Button runat="server" ID="btnSave" Text="Save" />
    </form>
</body>
</html>

Tuesday, December 13, 2011

Html Header Tag Sizes

  • H1 - 24pt / 32px
  • H2 - 18pt / 24px
  • H3 - 14pt / 18px
  • H4 - 12pt / 15px
  • H5 - 10pt / 13px
  • H6 - 8pt   / 11px
Above are the default font sizes in points and their approximate sizes in pixels
 

Copyrights(C) - Charith Gunasekara 2005-2010