C Board  

Go Back   C Board > General Programming Boards > C++ Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 08-24-2009, 12:06 PM   #1
Registered User
 
Join Date: Aug 2009
Posts: 13
how to write one png image in c++

hello,I encountered some problems in my homework.I was working on one small software.It's to draw flowchart . I was asked to save my flowchart in png format,but I don't konw how to do it.the file system of png is to hard for me.I am wondering is there exists any library can help me to solve the problem.We cannot coding in c# or using .net.we can only using c++ or some libraries in c++.I was very worry about it ,because the deadline is coming.Can anyone give me any advice.
sfguofen is offline   Reply With Quote
Old 08-24-2009, 12:26 PM   #2
Senior software engineer
 
brewbuck's Avatar
 
Join Date: Mar 2007
Location: Portland, OR
Posts: 5,381
Quote:
Originally Posted by sfguofen View Post
hello,I encountered some problems in my homework.I was working on one small software.It's to draw flowchart . I was asked to save my flowchart in png format,but I don't konw how to do it.the file system of png is to hard for me.I am wondering is there exists any library can help me to solve the problem.We cannot coding in c# or using .net.we can only using c++ or some libraries in c++.I was very worry about it ,because the deadline is coming.Can anyone give me any advice.
You want to use libpng.
__________________
"Congratulations on your purchase. To begin using your quantum computer, set the power switch to both off and on simultaneously." -- raftpeople@slashdot
brewbuck is offline   Reply With Quote
Old 08-24-2009, 07:19 PM   #3
Registered User
 
Join Date: Aug 2009
Posts: 13
Quote:
Originally Posted by brewbuck View Post
You want to use libpng.
Yes , i konw the library , however , i don't know how to set up the libpng in visual c++ 6.0,would you give me some book or some ur related to setting up the libpng in visual c++
sfguofen is offline   Reply With Quote
Old 08-24-2009, 07:57 PM   #4
(?<!re)tired
 
Mario F.'s Avatar
 
Join Date: May 2006
Location: Portugal
Posts: 5,220
Quote:
Originally Posted by sfguofen View Post
Yes , i konw the library , however , i don't know how to set up the libpng in visual c++ 6.0,would you give me some book or some ur related to setting up the libpng in visual c++
You should read the information available to you more closely...

  • Go to libpng homepage.
  • Take notice of the current version (1.2.39)
  • There's a readme section, so you should read it. Clicking on the first link in this section (local website), you'll learn that the file to download for windows is named lbpng1239.zip. You can also download a .7z or a .tar.bz2 version.
  • Going back to the homepage you'll scroll down to the download section, aptly named Source Code.
  • You download the zip version.
  • You open the zip file and read the INSTALL file within. It points you out to the location of the building instructions for windows: projects\visualc71\README.txt if you are using visual studio 2005 or later, or projects\visualc6\README.txt if you are using visual studio 6.0.
  • You follow the instructions
__________________
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.


Mario F. is offline   Reply With Quote
Old 08-25-2009, 12:55 AM   #5
Registered User
 
Join Date: Aug 2009
Posts: 13
Quote:
Originally Posted by Mario F. View Post
You should read the information available to you more closely...

  • Go to libpng homepage.
  • Take notice of the current version (1.2.39)
  • There's a readme section, so you should read it. Clicking on the first link in this section (local website), you'll learn that the file to download for windows is named lbpng1239.zip. You can also download a .7z or a .tar.bz2 version.
  • Going back to the homepage you'll scroll down to the download section, aptly named Source Code.
  • You download the zip version.
  • You open the zip file and read the INSTALL file within. It points you out to the location of the building instructions for windows: projects\visualc71\README.txt if you are using visual studio 2005 or later, or projects\visualc6\README.txt if you are using visual studio 6.0.
  • You follow the instructions
Thank you , I appreciate your help in setting up the libpng , but now another problem occured , It's that when I press CTRL+F5 to run the Pngtest , an message box about "Please specify the executable file.".It's said that the project need one .exe. but how can I build one executable file.
sfguofen is offline   Reply With Quote
Old 08-25-2009, 02:43 AM   #6
Registered User
 
Join Date: Aug 2009
Posts: 13
Quote:
Originally Posted by Mario F. View Post
You should read the information available to you more closely...

  • Go to libpng homepage.
  • Take notice of the current version (1.2.39)
  • There's a readme section, so you should read it. Clicking on the first link in this section (local website), you'll learn that the file to download for windows is named lbpng1239.zip. You can also download a .7z or a .tar.bz2 version.
  • Going back to the homepage you'll scroll down to the download section, aptly named Source Code.
  • You download the zip version.
  • You open the zip file and read the INSTALL file within. It points you out to the location of the building instructions for windows: projects\visualc71\README.txt if you are using visual studio 2005 or later, or projects\visualc6\README.txt if you are using visual studio 6.0.
  • You follow the instructions
Thank you again.I have solve the problem, and I can run the pngtest.exe now .
sfguofen is offline   Reply With Quote
Old 08-25-2009, 09:02 AM   #7
Registered User
 
Join Date: Apr 2007
Posts: 127
You don't need libpng or any lib on Windows (never, api does everything)
Png is native with Win32 api, like all formats (shell apis and others)
Alex31 is offline   Reply With Quote
Old 08-25-2009, 09:12 AM   #8
(?<!re)tired
 
Mario F.'s Avatar
 
Join Date: May 2006
Location: Portugal
Posts: 5,220
Quote:
Originally Posted by Alex31 View Post
You don't need libpng or any lib on Windows (never, api does everything)
Png is native with Win32 api, like all formats (shell apis and others)
Win32API is a library. libpng is a library. He needs something (eve if it meant writing his own). The option that was offered to him is probably the simplest and easiest to use, since the win32 api comes with a steep learning curve and is overkill for the one and only requirement he mentioned; ability to create a png file.
__________________
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.


Mario F. is offline   Reply With Quote
Old 08-25-2009, 06:10 PM   #9
Dae
Deprecated
 
Dae's Avatar
 
Join Date: Oct 2004
Location: Canada
Posts: 944
Quote:
Originally Posted by Alex31 View Post
You don't need libpng or any lib on Windows (never, api does everything)
Png is native with Win32 api, like all formats (shell apis and others)
Ew. o.0
Dae is offline   Reply With Quote
Old 08-27-2009, 01:03 AM   #10
Registered User
 
Join Date: Aug 2009
Posts: 13
Quote:
Originally Posted by Mario F. View Post
Win32API is a library. libpng is a library. He needs something (eve if it meant writing his own). The option that was offered to him is probably the simplest and easiest to use, since the win32 api comes with a steep learning curve and is overkill for the one and only requirement he mentioned; ability to create a png file.
O , I have read the manual of libpng , but I think only read the manual is not enough , for example ,png_write_image(png_ptr, row_pointers) , I don't know how the rows is made up .I think i need some examples about , how to draw picture in memory that I can use png_write_image() to save my picture directly
sfguofen is offline   Reply With Quote
Old 08-27-2009, 01:13 AM   #11
Registered User
 
Join Date: Aug 2009
Posts: 13
how to draw a picture in memory and save it directly by png_write_image() in libpng

I need to draw one flowchart in memory and save it in the png format . is there are any examples that can help me solve that problem.
sfguofen is offline   Reply With Quote
Reply

Tags
c++, flowchart, png, save

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
open read write close mercuryfrost C Programming 7 08-23-2009 05:27 PM
image processing ICool C Programming 75 10-15-2007 04:42 AM
Displaying a PNG image grep Windows Programming 5 07-07-2005 08:27 PM
airport Log program using 3D linked List : problem reading from file gemini_shooter C Programming 3 03-04-2005 02:46 PM
Some humour... Stan100 A Brief History of Cprogramming.com 8 11-06-2003 10:25 PM


All times are GMT -6. The time now is 02:21 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22