Sunday, August 18, 2013

Code for label text with new lines - asp.net C#

label1.Text=dt.Rows[0][""text"].ToString().Replace(Enviornment.NewLine,"<br>");

Change image image size in asp.net

int len = FileUpload1.PostedFile.ContentLength;
            byte[] picture = new byte[len];

Change color of image - Asp.net

Bitmap bmp = (Bitmap)Bitmap.FromFile("image.jpg");
for (int x = 0; x < bmp.Width; x++)
{
    for (int y = 0; y < bmp.Height; y++)
    {
        if (bmp.GetPixel(x, y) == Color.Red)
        {
            bmp.SetPixel(x, y, Color.Blue);
        }
    }
}
pictureBox1.Image = bmp;

Google Chat Back Badge

<div style=”position: fixed; bottom: 0px; right: 0px; width: 200px; height: 60px; z-index: 9000;”>   <iframe src="http://www.google.com/talk/service/badge/Show?tk=z01...6r&w=200&h=60" frameborder="0" width="200" height="60"></iframe> </div>