Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#Actualnickme

Posted 22 November 2012 - 01:01 PM

fread( data, 1, width * height * 3, file );
fclose( file );

Here's your problem, you can't read directly from a png file, it's compressed. You need to decompress it first in order to get any useful data. I would recommend using an image loading library like FreeImage or SOIL.


thanks icOde.

i wonder whether it is compatible with msvc 2010 c++?  i tried to load the sln file into vc 2010, but it failed.

#1nickme

Posted 22 November 2012 - 09:50 AM

fread( data, 1, width * height * 3, file );
fclose( file );

Here's your problem, you can't read directly from a png file, it's compressed. You need to decompress it first in order to get any useful data. I would recommend using an image loading library like FreeImage or SOIL.


thanks icOde.

i wonder whether it is compatible with msvc 2010 c++?

PARTNERS