Dim i As Integer
Dim GIMA As RecordSet
Dim ImagenCarp As FolderItem
Dim Foto As Picture
GIMA = Android.SQLSelect("SELECT FotoEvidencia FROM evidenciaext WHERE NombreEvidencia='" + Trim(PopPlanta.Text) + "'AND HoraEvi='" + Trim(ListaDetalles.Cell(ListaDetalles.LastIndex, 0)) + "'")
ImagenCarp = SpecialFolder.Windows.Child("/Temp/")
Foto=GIMA.Field("FotoEvidencia").PictureValue
For i = 0 To ListaDetalles.ListCount -1
Foto.Save(ImagenCarp.Child("/TempXojo/" + ListaDetalles.Cell(ListaDetalles.LastIndex, 1) + ".jpg") , Picture.SaveAsJPEG)
MsgBox "Admin"
Next
You should keep the number of images based on the number of records in the ListBox.
I just saved the first image
ok… you read a photo from a data base
then you save that photo TO THE SAME FILE supposedly as many times as you have rows in ListaDetalles
[lastindex only changes on ADDROW, which I do not see anywhere]
So my question is. DOES ListaDetalles have anything in it? is so, How did it get there?
[code] ListaDetalles.DeleteAllRows
CONSULTA = Android.SQLSelect(“SELECT * FROM infoext WHERE OCRs=’” + Trim(PopPlanta.Text) + “‘AND FechaRevs=’” + Trim(PopFecha.Text) + “’”)
If CONSULTA <> Nil Then
While Not CONSULTA.EOF
ListaDetalles.AddRow(CONSULTA.Field(“HoraRevs”).StringValue)
ListaDetalles.Cell(ListaDetalles.LastIndex, 1)=CONSULTA.Field(“Ubicacions”).StringValue
ListaDetalles.Cell(ListaDetalles.LastIndex, 2)=CONSULTA.Field(“CondicionesCilindros”).StringValue
ListaDetalles.Cell(ListaDetalles.LastIndex, 3)=CONSULTA.Field(“Observaciones”).StringValue
ListaDetalles.Cell(ListaDetalles.LastIndex, 4)=CONSULTA.Field(“Hologramas”).StringValue
ListaDetalles.Cell(ListaDetalles.LastIndex, 5)=CONSULTA.Field(“CollarinPQSs”).StringValue
ListaDetalles.Cell(ListaDetalles.LastIndex, 6)=CONSULTA.Field(“CapacidadAreas”).StringValue
ListaDetalles.Cell(ListaDetalles.LastIndex, 7)=CONSULTA.Field(“AgenteAreas”).StringValue
ListaDetalles.Cell(ListaDetalles.LastIndex, 8)=CONSULTA.Field(“Alturas”).StringValue
ListaDetalles.Cell(ListaDetalles.LastIndex, 9)=CONSULTA.Field(“Obstruccions”).StringValue
ListaDetalles.Cell(ListaDetalles.LastIndex, 10)=CONSULTA.Field(“Delimitacions”).StringValue
ListaDetalles.Cell(ListaDetalles.LastIndex, 11)=CONSULTA.Field(“Senalamientos”).StringValue
ListaDetalles.Cell(ListaDetalles.LastIndex, 12)=CONSULTA.Field(“EtiquetaInspeccions”).StringValue
ListaDetalles.Cell(ListaDetalles.LastIndex, 13)=CONSULTA.Field(“Manometros”).StringValue
ListaDetalles.Cell(ListaDetalles.LastIndex, 14)=CONSULTA.Field(“Cornetas”).StringValue
ListaDetalles.Cell(ListaDetalles.LastIndex, 15)=CONSULTA.Field(“Mangueras”).StringValue
ListaDetalles.Cell(ListaDetalles.LastIndex, 16)=CONSULTA.Field(“Manerals”).StringValue
ListaDetalles.Cell(ListaDetalles.LastIndex, 17)=CONSULTA.Field(“SeguroMetalicos”).StringValue
ListaDetalles.Cell(ListaDetalles.LastIndex, 18)=CONSULTA.Field(“ColaRatas”).StringValue
ListaDetalles.Cell(ListaDetalles.LastIndex, 19)=CONSULTA.Field(“Ganchos”).StringValue
ListaDetalles.Cell(ListaDetalles.LastIndex, 20) = PopPlanta.Text
CONSULTA.MoveNext
Wend
CONSULTA.Close
End If
Dim i As Integer
Dim GIMA As RecordSet
Dim ImagenCarp As FolderItem
Dim Foto As Picture
GIMA = Android.SQLSelect(“SELECT FotoEvidencia FROM evidenciaext WHERE NombreEvidencia=’” + Trim(PopPlanta.Text) + “‘AND HoraEvi=’” + Trim(ListaDetalles.Cell(ListaDetalles.LastIndex, 0)) + “’”)
ImagenCarp = SpecialFolder.Windows.Child("/Temp/")
Foto=GIMA.Field(“FotoEvidencia”).PictureValue
For i = 0 To ListaDetalles.ListCount -1
Foto.Save(ImagenCarp.Child("/TempXojo/" + ListaDetalles.Cell(ListaDetalles.LastIndex, 1) + “.jpg”) , Picture.SaveAsJPEG)
Next
[/code]
Ok… you are STILL saving the photo over and over again to the same file!
replace LASTINDEX with “I”
LASTINDEX ONLY CHANGES WHEN YOU ADD A ROW… so it is NOT changing inside you for/next loop.
The loop is working fine… you are just doing the same thing over and over
I have provided all the information I can… either if fixes your situation or it doesn’t… but I’m afraid the language barrier is making it difficult for me to understand either your problem, or how better to explain my responses.
Maybe a bit off-topic, but Mr Hernandez, aren’t you going a bit over your limits? It’s obvious that your knowledge is not that big about programming, and your already trying to run with databases.
Sorry people! I was not trying to offend Mr Hernandez. I don’t meant he crossed any lines.
I really meant his limits. (Meant as advice, to study the basics, before trying to do big stuff)
I did not meant that he cannot ask questions here. Because I also do, also about very stupid things.
Sorry if I offended anyone, or if I expressed myself wrong.
I really didn’t meant to do that.
Utiliza el canal español del foro de Xojo si tienes cualquier tipo de problema con el inglés. En el resto de canales el inglés es el idioma oficial.
Por cierto Mathias estaba pidiéndote disculpas por si su mensaje ha molestado y/o haberse malentendido, cosa loable y no creo que merezca una crítica o respuesta así. Aquí estamos todos para ayudarnos los unos a los otros y ni todo el mundo habla inglés ni por supuesto en español.
Escribe un nuevo mensaje en el foro Español y verás que hay gente que puede ayudarte.