Add Two images

May 6, 2011 at 3:10 PM

I have two tif files that are two halves to a whole picture.  The north and south section of a map.  Is there an easy way to load the two tif files so they make a whole picture again in an AxMapWinGis.AxMap?

Coordinator
May 6, 2011 at 5:48 PM

As long as they are georeferenced with correct world files then they will appear lined up correctly in the map. 

May 6, 2011 at 6:26 PM

Can you give some example code on how to add the two images to one map control?

 

right now I basically have...

 

Dim img As New MapWinGIS.Image

img.UseTransparencyColor =False 

img.Open(LocalDir & "\" & FileName, MapWinGIS.ImageType.USE_FILE_EXTENSION)

 

Thanks in advance

...

 

 

Dim myChart As AxMapWinGIS.AxMap

  

 

  _ChartLayoutS(theChart).ChartHandle = myChart.AddLayer(img, True)

Coordinator
May 6, 2011 at 8:18 PM

Your code looks right. Just duplicate it for the second image. However, if your image file does not have an associated world file then they will not line up right. A world file tells mapwindow where the image lives on the earth. If your file is test.bmp then your world file should be called test.bpw. If it is test.tiff then your world file should be test.tfw. Do you have world files? If not then you can create them. Just do a google search for "tiff world file". - Dan

May 6, 2011 at 9:11 PM

Thank you.  I wasn't using the tfw files for my application.  But now that I add them it works perfectly.  Thank you very much.  You just saved me hours of coding....