How to show Horizontal List of Image

6 posts, 0 answers
  1. Dario Concilio
    Dario Concilio avatar
    129 posts
    Member since:
    Apr 2016

    Posted 25 Jul Link to this post

    Hi,

    I would print a list of image, these images are certified mark and I have to show theme in horizontal orientation.

    But these pictures could be seen all, or only some. But those that remain visible must all be near and no spaces.
    I tried to use the crosstable, but it seems that is not working.
    How can I do?

  2. Stef
    Admin
    Stef avatar
    3053 posts

    Posted 25 Jul Link to this post

    Hello Potito,

    Please test adding a List item. Then select the item and its 'Rotate Layout' option from the Context menu - this will cause the item to grow horizontally.

    You can place a PictureBox item in the cell of the List item, and then bind the List.DataSource property to a list of paths to images. The PictureBox.Value property can be set via expression to the field representing the image path.

    Regards,
    Stef
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft banner
  4. Dario Concilio
    Dario Concilio avatar
    129 posts
    Member since:
    Apr 2016

    Posted 25 Jul in reply to Stef Link to this post

    I already tried this approach, but surpassing the amount of 4 images in sequence, were not even printed.
    I found a way code solution through the collection of images, I create a bitmap and compose through the Graphics object, by managing the proportion of individual bitmap.

     

    01.Public ReadOnly Property SequenceImages As Image
    02.    Get
    03. 
    04.        Dim _Items = MySharedMethods.GetImages
    05. 
    06.        'Create a dictionary with the index of each image and the correct size of each setting constant as the height, maintaining the proportion
    07.        Dim _ItemsDictionary = New Dictionary(Of Integer, Size)
    08. 
    09.        Dim _CompleteWith As Integer = 0
    10.        Dim _CompleteHeight As Integer = m_DimensioneMarchi
    11. 
    12.        Dim _Height = m_DimensioneMarchi
    13. 
    14.        For _Index = 0 To _Items.Count - 1
    15. 
    16.            Dim _Image = _Items(_Index).Marchio
    17. 
    18.            Dim _Width = CInt((_Image.Width * m_DimensioneMarchi) / _Image.Height)
    19. 
    20.            _ItemsDictionary.Add(_Index, New Size(_Width, _Height))
    21. 
    22.            'Trace the length of the final bitmap
    23.            _CompleteWith += (_Width + m_MargineMarchi)
    24. 
    25.        Next
    26. 
    27.        'I compose the final bitmap based on the information of the previously constructed Dictionary
    28.        Dim _Bitmap As New Bitmap(_CompleteWith, _CompleteHeight)
    29. 
    30.        Dim _Graphics = Graphics.FromImage(_Bitmap)
    31. 
    32.        With _Graphics
    33. 
    34.            .CompositingMode = Drawing2D.CompositingMode.SourceCopy
    35.            .CompositingQuality = Drawing2D.CompositingQuality.HighQuality
    36. 
    37.            .Clear(Color.White)
    38. 
    39.            Dim _X As Integer = 0
    40. 
    41.            For Each _Item In _ItemsDictionary
    42. 
    43.                Dim _Size = _Item.Value
    44. 
    45.                .DrawImage(_Items(_Item.Key).Marchio, _X, 0, _Size.Width, _Size.Height)
    46. 
    47.                'It moves the horizontal position for the next mark
    48.                _X += (_Size.Width + m_MargineMarchi)
    49. 
    50.            Next
    51. 
    52.            .Dispose()
    53. 
    54.        End With
    55. 
    56.        Return _Bitmap
    57. 
    58.    End Get
    59. 
    60.End Property

  5. Dario Concilio
    Dario Concilio avatar
    129 posts
    Member since:
    Apr 2016

    Posted 25 Jul in reply to Dario Concilio Link to this post

    Excuse me, I left a few variables in Italian, below the translations:

    m_DimensioneMarchi = Height constant of all images

    m_MargineMarchi = Margin width that needs between images

    _Items(_Index).Marchio = MySharedMethods.GetImages returns a List(Of MyObject), this one has 2 property: Index as Integer and , Marchio as Image

  6. Dario Concilio
    Dario Concilio avatar
    129 posts
    Member since:
    Apr 2016

    Posted 25 Jul in reply to Dario Concilio Link to this post

    My example in action, there are simply 2 PictureBox of report.
  7. Stef
    Admin
    Stef avatar
    3053 posts

    Posted 28 Jul Link to this post

    Hi Potito,

    We are glad to hear you found a solution.

    In case you still want to test the suggested approach, please check the attached TRDP file in the Standalone Report Designer of Telerik Reporting R2 2016 or later. There is also a video - SWF file, that can be previewed in IE browser.

    Regards,
    Stef
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
DevCraft banner