Hello,
For my neighbour i am creating a photoalbum.
But when i load more then 110 photo's in a flowlayoutpanel with pictureboxes i get the error outofmemoryexce ption was unhandled.
Do i need to resize the picture before loading them or can i do something else?
This is my code for loading:
Regards, Paul
For my neighbour i am creating a photoalbum.
But when i load more then 110 photo's in a flowlayoutpanel with pictureboxes i get the error outofmemoryexce ption was unhandled.
Do i need to resize the picture before loading them or can i do something else?
This is my code for loading:
Code:
Dim Table As DataTable
Dim i As Integer
FlowLayoutPanel1.Controls.Clear()
Dim SQL As String = "SELECT fotonaam, fotomap, textveld FROM foto WHERE (fotomap = '" & Replace(CmbPath.Text, "'", "''") & "');"
Table = SelectQuery(SQL)
Dim ThumbPicturearr(Table.Rows.Count) As PictureBox
While Table.Rows.Count <> i
ThumbPicturearr(i) = New PictureBox
ThumbPicturearr(i).Name = "Foto" & i
ThumbPicturearr(i).Height = 134
ThumbPicturearr(i).Width = 164
ThumbPicturearr(i).BackColor = Color.DarkGray
ThumbPicturearr(i).Image = Image.FromFile(Table.Rows(i).Item("fotomap") & "\" & Table.Rows(i).Item("fotonaam"))
ThumbPicturearr(i).SizeMode = PictureBoxSizeMode.Zoom
ThumbPicturearr(i).BorderStyle = BorderStyle.Fixed3D
FlowLayoutPanel1.Controls.Add(ThumbPicturearr(i))
i = i + 1
End While
Table.Dispose()
Comment