Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 84751

How to show Horizontal List of Image

$
0
0

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.PublicReadOnlyPropertySequenceImages AsImage
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 = NewDictionary(Of Integer, Size)
08. 
09.        Dim_CompleteWith AsInteger= 0
10.        Dim_CompleteHeight AsInteger= 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, NewSize(_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 AsNewBitmap(_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 AsInteger= 0
40. 
41.            ForEach_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.        EndWith
55. 
56.        Return_Bitmap
57. 
58.    EndGet
59. 
60.EndProperty

Viewing all articles
Browse latest Browse all 84751


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>