Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
3
Erster Beitrag:
vor 3 Jahren
Letzter Beitrag:
vor 3 Jahren
Beteiligte Autoren:
Arekusei Timakobu, Fabrice Harari

Quick conversion array to buffer - **solved**

Startbeitrag von Arekusei Timakobu am 27.01.2015 09:04

I use some HTTP API that outputs raw image data as response on web request. The result is array of bytes (array of 1-byte unsigned int). I use .Net stream to read data. I need to display result image on Image control so I need to convert result array into Buffer. Now I use the simple algoryhtm:


// get the image raw data
arrBytes is array of [1024] 1-byte unsigned int
BufferedStream.Read(arrBytes,0,1024)
// convert array to buffer byte per byte
bufBuffer is Buffer
FOR nByte in arrBytes
bufBuffer += Charact(nByte)
END



But the little problem is slow process. As bigger array as longer process is going. 40Kbytes are processed about few seconds but when I get array more then 1Mbyte (HD image) the process is "hangs". Could you someone help me?

Antworten:

Re: Quick conversion array to buffer

Hi

You can try using "transfer" instead of your copy by byte, that should be much faster...

Best regards

von Fabrice Harari - am 27.01.2015 09:47

Re: Quick conversion array to buffer

Quote
Fabrice Harari
You can try using "transfer" instead of your copy by byte, that should be much faster...


Thank you for your answer. I tried so


bufBuffer is Buffer
arrArray is array of 1-byte unsigned int
Transfer(&bufBuffer,&arrArray,arrArray..Occurence)

and I have got an error:

Bad destination address (0x00000000 on 23904 bytes). It does not match a valid 8memory address in write mode.

UPD: Fixed!

sfBuffer is fixed string on 2097152 // 2 MBytes
bufBuffer is Buffer
arrArray is array of 1-byte unsigned int
Transfer(&sfBuffer,&arrArray,arrArray..Occurence)
bufBuffer = sfBuffer


von Arekusei Timakobu - am 27.01.2015 10:26
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.