Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: LoadJPGFromPtr


Message #1 by "Bernhard Doebler" <programmer@b...> on Tue, 17 Jul 2001 14:17:30 +0200
Hi,

I'm about do download a JPG from the web, keep it in memory and show it 
in a PictureBox. I wanted to do this using the JPG-library from 
www.vbaccelerator.com 
(http://www.vbaccelerator.com/codelib/gfx/vbjpeg.htm) To test it I 
create the ByteArray manually. I read the Picture using standard file 
functions. When I then call <b>LoadJPGFromPtr<b> I get the error -5.

Have you ever had the same problem? Have you solved it? How? Are there 
other ways to show JPGs stored in memory in a PictureBox without saving 
to disk?

Best Regards
Bernhard Doebler

p.S. The creation of the ByteArray looks like so:

Dim Datei As Integer
Dim daten() As Byte
Dim filesize As Integer

Datei =3D FreeFile
Open "d:\reste\bardbild.jpg" For Binary As Datei
filesize =3D LOF(Datei)
ReDim daten(filesize)
Get Datei, LOF(Datei), daten(0)
Close Datei

LoadJPGFromPtr m_cDib, VarPtr(daten(0)), filesize




  Return to Index