Results 1 to 2 of 2

Thread: How Can I print All Images in DataBase Records ?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2018
    Posts
    77

    How Can I print All Images in DataBase Records ?

    hi Everyone.

    I have a Database (Access or Sql Database) and in this database I have pictures of Records.

    I want to Print all this images in one page. I try to get images from DataGridView Column. But I can Get only certain Record Image. and all image is same.

    Code:
    For y = 37.43 + 15 To (133.67 * 8) Step 133.67 '10 To 650 Step 150
    
    For x = 6.05 + 15 To (390.75 * 2 + 9.86) Step (390.75 + 9.86) '10 To (832 - 397) Step 419  '20 To 530 Step 350
    
    Dim img As Byte() = CType(DgV.CurrentRow.Cells(17).Value, Byte())
    Dim ms As MemoryStream = New MemoryStream(img)
                            
    e.Graphics.DrawImage(Image.FromStream(ms), CInt(x + 300), CInt(y + 35), (CInt(PictureBox1.Width / 2.5)), (CInt(PictureBox1.Height / 2.5)))
    Next
    Next
    There are 12 records in Database. how can I get all images and print

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,347

    Re: How Can I print All Images in DataBase Records ?

    Firstly, the grid should be irrelevant. You should be populating a DataTable from the database and that is where you should be getting the image data from. Before you even consider printing anything, you should be making sure you can do that and get all those images. Only when you can do that should you then try printing multiple images. Once you can do both, put the two together as a last step. When you try to solve multiple problems at the same time, you often end up solving none, which is what you're doing. Stop, think and break your problem down into the smallest possible parts before doing anything else.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width