如何在不重叠的情况下显示一行大小不同的图像?

how do I display a row of images that are of different sizes without overlapping?

我想要一个基本的小程序,可以连续显示多个图像而不重叠。但由于并非所有图像文件都是相同的,因此很难做到。

dir = Program.Directory
imagedir = dir + "\images\"
GraphicsWindow.BrushColor = "White"
For i = 1 To 27
  i_name= File.ReadLine(imagedir+"\imagedata.txt",b) 'imagedata contains the names of all the images in the directory so I don't have to list all the names in the program.
  image[i] = ImageList.LoadImage(imagedir+i_name+".png")
  imagewidth[i] = ImageList.GetWidthOfImage(image[i])
  GraphicsWindow.DrawImage(block[i],(i-1)*imagewidth[i-1],0) 'This is where the trouble lies.
EndFor

我认为您需要另一个变量来存储 x 坐标。每次绘制图像时,您应该将变量的宽度加上边距增加。然后,当你绘制下一个图像时,将其绘制在变量指示的位置。