Results 1 to 5 of 5

Thread: [RESOLVED] display picture from folder in a grid

  1. #1

    Thread Starter
    Hyperactive Member binilmb's Avatar
    Join Date
    Nov 2005
    Location
    Kochi
    Posts
    472

    Resolved [RESOLVED] display picture from folder in a grid

    is it possible to display picture from folder in a grid? if it is what type of grid is used for it

  2. #2
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: display picture from folder in a grid

    Do you mean as the background, or in a cell on the grid, or to display a picture based on a grid (like a file location) ?

  3. #3

    Thread Starter
    Hyperactive Member binilmb's Avatar
    Join Date
    Nov 2005
    Location
    Kochi
    Posts
    472

    Re: display picture from folder in a grid

    there may be one or more pictures in the folder. if there is three pictures in a folder i want to display it in three cells in a grid
    ßįňįl

  4. #4
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: display picture from folder in a grid

    Quote Originally Posted by binilmb
    there may to one or more pictures in the folder. if there is three pictures in a folder i want to display it in three cells in a grid
    You can use a MSFlexgrid.
    Check this example to assign a Picture (loaded from file) to all cells in a column:
    Code:
    Option Explicit
     
    Private Sub SetColPicture(pColumn As Long, pPic As Picture)
        With MSFlexGrid1
            .FillStyle = flexFillRepeat 'This is to apply to the selection
            .Row = 1
            .Col = pColumn
            .RowSel = .Rows - 1
            .ColSel = pColumn
            Set .CellPicture = pPic
            .FillStyle = flexFillSingle 'Change back to fillsingle
        End With
    End Sub
    
    Private Sub Command1_Click()
    Dim i As Long
        'Set the Row height in a loop..
        For i = 1 To MSFlexGrid1.Rows - 1
            MSFlexGrid1.RowHeight(i) = 400
        Next
       'Format: SetColPicture <ColumnNumber>,<Picture>
        SetColPicture 1, LoadPicture("c:\windows\soap bubbles.bmp")
    End Sub

  5. #5
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: display picture from folder in a grid

    Oh, you don't want the full column, to it's easier, somethihg like..
    Code:
        With MSFlexGrid1
            .Row = 1: .Col = 1
            .RowHeight(1) = 400 'The height you want
            Set .CellPicture = LoadPicture("c:\Pic1.JPG")
            .Row = 2: .Col = 1
            .RowHeight(2) = 400 'The height you want
            Set .CellPicture = LoadPicture("c:\Pic2.JPG")
            .Row = 3: .Col = 1
            .RowHeight(3) = 400 'The height you want
            Set .CellPicture = LoadPicture("c:\Pic3.JPG")
       End With

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