0

I want a small basic program that can display multiple images in a row without overlapping. But since not all image files are the same, it's hard to do so.

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
Auxhi
  • 5
  • 2
  • can you put your whole program? It would help. and if you need to put it on different rows, you need height as well. – Matthew Feb 28 '17 at 19:36
  • I figure if i can get the images from overlapping on the horizontal, the same could apply for the vertical. This is just a test program, so this is all there is in it. If the images were all the same dimension, I wouldn't be asking for help, but with different image dimensions, I kind of need it. – Auxhi Feb 28 '17 at 22:31
  • ok but what you need is if its over lapping to go and adjust it by a little bit in the (I-1)*imagewidth[I-1]. – Matthew Mar 01 '17 at 01:51
  • Yes. I'm taking the width of the previous image and trying to adjust the next images position based on that. – Auxhi Mar 01 '17 at 21:41
  • RIght, so just add a manual adjuster for that. – Matthew Mar 27 '17 at 22:01

1 Answers1

0

I think you'd need another variable for storing the x coordinate. Every time you draw an image, you should increase the variable by its width plus the margin. Then, when you draw the next image, draw it at the position indicated by the variable.

FlatAssembler
  • 667
  • 7
  • 30