Asuntos Oficiales > Retos
Formato Bmp
Enko:
Juank, recuerdo que habías pedido una copia de una imagen que causara el problema, te adjunto una de ellas.
(creo que se producen cuando creas el BMP original con ButonDerecho>>Nuevo>>Imagen de mapa de Bits, en el explorador y luego la modificas con paint)
JuanK:
Gracias enko.
Si convierten esta a bmp tambien les puede fallar.
JuanK:
He recibido la solucion de Nagisa y Diodo. :comp:
Los demas animense!!! :lol:
Enko:
Ya encontré la solucion.
Como el intercambio de info en el thread está permitido,
Posteo en Ingles, ya que no soy buen traductor. Eso es lo único que hace falta ademas de saber como es la cabecera.
--- Citar ---Few things to remember
1) Unfortunately, BMP data is not written from left to right -> left to right etc (like we read a book), insted it is written from right to left -> right to left etc from Bottom to Top. That means writing of pixel data starts from Bottom Right and ends in Top Left. In our example the problem will not reflect, since all the 100 (10 x 10) pixels are same pale magenta!
2) The number of bytes of the Picture Data in one each row should be a multiple of 4. We have to padd extra zeroes to kame it a multiple of 4. In our case, the picture's width is 10 pixels. So find the remainder of the division 10 / 4. The remainder is 2. So TWO zero bytes should be padded with each row's data.
--- Fin de la cita ---
Con el heditor exadecimal me había dado cuenta que se agregaban 00 demás, pero pensé que solo era al final del archivo y no entendía el sentido.
JuanK:
oK , LA INFROMACION ESTA DEVUELTA.
Mi solucion, si mal no estoy es:
--- Código: Text ---ancho= (BMPwith * bytesPerPixel);... ancho+= ancho%4;bitsize = ancho * alto_imagen;
Navegación
[#] Página Siguiente
[*] Página Anterior
Ir a la versión completa