Ver Mensaje Individual
  #2 (permalink)  
Antiguo 12/11/2008, 06:25
Mirador
 
Fecha de Ingreso: abril-2007
Mensajes: 82
Antigüedad: 17 años, 1 mes
Puntos: 0
Respuesta: [vb.net 2003] Unir imagenes

Solucionado, gracias igualmente.

Pongo el codigo por si a alguien le sirve:

Código:
Private Sub sImprimirLeyenda()
        Dim i As Integer
        Dim axLayer As ESRI.MapObjects2.Core.MapLayer
        Dim img() As Bitmap
        Dim z As Integer = 0
        Dim imgFinal As Bitmap
        Dim g As Graphics
        Dim intHeigh As Integer = 0
        Try
            If Not Me.axLeyenda.Visible Then
                axLeyenda.setMapSource(AxMapa)
                axLeyenda.LoadLegend(True)
                axLeyenda.ShowAllLegend()
                axLeyenda.set_Active(0, True)
                sRedimensionarControles_VisualizarLeyenda()
            End If
            For i = 0 To Me.AxMapa.Layers.Count - 1
                axLayer = Me.AxMapa.Layers.Item(i)
                If axLayer.Visible Then
                    If fCheckLayerInMap(axLayer) Then
                        Me.axLeyenda.ExportToBmp("C:\Borrame\" & i & ".bmp", i)
                        ReDim Preserve img(z)
                        img(z) = New Bitmap("C:\Borrame\" & i & ".bmp")
                        'g.DrawImage(img(z), 0, intHeigh)
                        intHeigh = intHeigh + img(z).Height
                        'imgFinal.Height = intHeigh
                        z += 1
                    End If
                End If
            Next
            imgFinal = New Bitmap(Me.axLeyenda.Width, intHeigh, Imaging.PixelFormat.Format32bppArgb)
            g = Graphics.FromImage(imgFinal)
            intHeigh = 0
            For i = 0 To img.Length - 1
                g.DrawImage(img(i), 0, intHeigh)
                intHeigh = intHeigh + img(i).Height
            Next
           imgFinal.Save("C:\leyenda.bmp", Imaging.ImageFormat.Bmp)
        Catch ex As Exception
            MsgBox("Error: " & ex.Message & vbNewLine & "Traza: " & ex.StackTrace)
        Finally
            sRedimensionarControles_OcultarLeyenda()
            i = Nothing
            axLayer = Nothing
            img = Nothing
            z = Nothing
            g.Dispose()
            g = Nothing
            imgFinal = Nothing
            intHeigh = Nothing
        End Try
    End Sub
Saludos!