New topic: 

picture.fromdata not working with png files

<http://forums.realsoftware.com/viewtopic.php?t=45904>

         Page 1 of 1
   [ 2 posts ]                 Previous topic | Next topic          Author  
Message        basestring          Post subject: picture.fromdata not working 
with png filesPosted: Wed Nov 14, 2012 1:31 am                                 
Joined: Sat May 28, 2011 11:28 pm
Posts: 119
Location: Beijing China                hi, 

I'm trying to load pictures with picture.FromData(d.b)
if d.b contains JPG image memoryblock, then it works fine, but if it contains 
PNG data, then the picture stays nil

any idea why, or how to solve this

thanks      
_________________
For great Music got to my podcast Website!!!
http://podcast.1945mf-china.com  
                             Top                amitavak          Post subject: 
Re: picture.fromdata not working with png filesPosted: Wed Nov 14, 2012 9:35 am 
                                
Joined: Mon Jan 02, 2012 1:51 am
Posts: 360
Location: India                I tested with the following code works 
perfectly...

  Dim f As FolderItem = GetOpenFolderItem("*")

If f <> Nil Then
  
  Dim tmpPicture As Picture
  Dim bStream As BinaryStream
  Dim tmpMemBlock As MemoryBlock
  
  bStream = BinaryStream.Open(f)
  tmpMemBlock = bStream.Read(bStream.Length)
  
  tmpPicture = Picture.FromData(tmpMemBlock)
  
  If tmpPicture <> Nil Then
  
  ImageWell1.Image = tmpPicture
  
  End If
  
End If
      
_________________
Amitava Karan
Real Studio 2012 Release 1
Windows 7 (32 bit)
Mac OS X Version 10.7  
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 2 posts ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to