google

Newest Post

Microsoft Excel - Unmerge cells and fill down the values in all rows

| Tuesday, March 22, 2016
Read more »
This can be done using Go to Special command in Find and Select option. Following are the steps to achieve this.
1. Select the columns that have merged cells.
2. Click Home > Merge & Center > Unmerge Cells
3. The merged cells have been unmerged and only the first cell will be filled with the original values. Keep the range selected or select the range again.
4. Click Home > Find & Select > Go To Special. In the Go To Special dialog box, select Blanks option

5. Click OK, all of the blank cells in the range have been selected. Then input = and press Up arrow key on the keyboard.
6. Press Ctrl + Enter keys, all of the blank cells have been filled with the original merged data.

And

TaDa!!!! DONE

Convert base64 into Image, Resize the image and again convert it into base64

| Saturday, March 5, 2016
Read more »
Convert base64 into Image, Resize the image and again convert it into base64

Use Following Code:

                       byte[] bytes = (byte[])row["Picture"];

                        Image image;

                       //Convert byte[] into image
                        using (MemoryStream ms = new MemoryStream(bytes))
                        {
                            image = Image.FromStream(ms);
                        }

                        // Resize the image
                        Bitmap b = new Bitmap(200, 200);
                        Graphics g = Graphics.FromImage((Image)b);
                        g.InterpolationMode = InterpolationMode.HighQualityBicubic;

                        g.DrawImage(image, 0, 0, 200, 200);
                        g.Dispose();
                        image = (Image)b;

                        using (MemoryStream ms = new MemoryStream())
                        {
                            // Convert Image to byte[]
                            image.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
                            byte[] imageBytes = ms.ToArray();

                            // Convert byte[] to Base64 String
                            string base64String = Convert.ToBase64String(imageBytes);
                            obj.StudentPicture = base64String;
                        }

Convert base64 into Image, Resize the image and again convert it into base64

Posted by : Stranger
Date :Saturday, March 5, 2016
With 0comments
Next Prev
▲Top▲