Click here to Skip to main content
15,880,427 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I m getting data from database in datagridview but my image is zoomed
i want normal size image in datagridview


any help will be appreciated

thanks


this is my class code

C#
    public byte[] img(Image ImageIn)
        {
            var bnew = new Bitmap(ImageIn);
            var ms = new MemoryStream();
            bnew.Save(ms, ImageFormat.Bmp);
            return ms.ToArray();
        }

     public Image ConverttoImg(byte[] imgdata)
        {
            return Image.FromStream(new MemoryStream(imgdata));
        }

     public DataTable View_images()
        {
            return db.ExecuteDataSet("prod_images").Tables[0];
        }

// this is my code for populating datagridview
private void Product_List_Load(object sender, EventArgs e)
        {
            dataGridView1.DataSource = prod.View_images();

        }
Posted
Updated 15-Sep-13 1:35am
v2
Comments
Mehdy Moini 15-Sep-13 7:16am    
You didn't resize the picture in saving and reading from database, Are you sure your picture is not in big size, please note if your picture is in big size, some tools which is for showing images, show it in normal size, but that's not real size, check your original image size in it's properties, and resize if you need!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900