Article View: free.it.visual-basic
Article #823bitmap decodifica
From: Antonios
Date: Sat, 06 Aug 2005 07:26
Date: Sat, 06 Aug 2005 07:26
53 lines
2738 bytes
2738 bytes
Salve a tutti, sto cercando di capire come decodificare una immagine bmp. Fin ora ho capito come "funziona" quella a 24bit, ho capito come trovare le dimensioni della stessa e come sono disposti i 3 byte per i colori. A me servono proprio questi punti colorati proprio perche devo farci delle operazioni 3d. Ora sto notando che pur avendo un pc abbastanza nuovo per caricare delle bmp a 24bit di grandi dimensioni, passa parecchio tempo. Sto usando la sub sotto, che legge i 3 byte uno alla volta... Non potreste cortesemente suggerirmi un modo per velocizzare il tutto? Se pu� servire...come si fa a dichiarare un tipo di dati di 3byte invece che di 1(byte) o 2(integer) o 4(long) byte? Come decodifico quelle a 8bit che sono piu piccole in dimensione e con sufficiente informazione sul colore? Ho creato una bmp a 8bit di un solo pixel ma occupa 2kbyte quasi....che altre info ci sono dentro? Sub CARICABMP(nome$) Open "C:\12.bmp" For Binary As 1 Dim Intestazione(54) As Byte Dim R As Byte Dim G As Byte Dim B As Byte Rem legge le informazioni iniziali For T = 1 To 54 Get #1, T, Intestazione(T) Next T Rem calcola le dimensioni della bmp lunghezza = Intestazione(19) * 256 ^ 0 + Intestazione(20) * 256 ^ 1 + Intestazione(21) * 256 ^ 2 + Intestazione(22) * 256 ^ 3 Larghezza = Intestazione(23) * 256 ^ 0 + Intestazione(24) * 256 ^ 1 + Intestazione(25) * 256 ^ 2 + Intestazione(26) * 256 ^ 3 Text1.Text = Str$(lunghezza) + " " + Str$(Larghezza) For LNZ = Larghezza To 1 Step -1 For LGZ = 1 To lunghezza Step 1 Get #1, , B Get #1, , G Get #1, , R Schermo.PSet (LGZ * 15, LNZ * 15), RGB(R, G, B): Rem Schermo � una picturebox Next Next Close 1 End Sub
Technical Details
Message-ID:
<%CZIe.37133$2U1.2092505@news3.tin.it>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!news-out.tin.it!news-in.tin.it!news3.tin.it.POSTED!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: f94ee,bc15110764c1e5d2,start X-Google-Attributes: gidf94ee,public X-Google-Language: ITALIAN,ASCII Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!news-out.tin.it!news-in.tin.it!news3.tin.it.POSTED!not-for-mail Reply-To: "Antonios" <acsoftware@virgilio.it> From: "Antonios" <acsoftware@virgilio.it> Newsgroups: free.it.visual-basic Subject: bitmap decodifica Lines: 55 Organization: ACSoftware 2000 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Message-ID: <%CZIe.37133$2U1.2092505@news3.tin.it> Date: Sat, 06 Aug 2005 07:26:51 GMT NNTP-Posting-Host: 82.57.55.180 X-Complaints-To: "Please send abuse reports to abuse@tin.it and technical notifications to newsmaster@tin.it" X-Trace: news3.tin.it 1123313211 82.57.55.180 (Sat, 06 Aug 2005 09:26:51 MET DST) NNTP-Posting-Date: Sat, 06 Aug 2005 09:26:51 MET DST