Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VC6
Hi Guys,
 
iam coverting a Image to PNG ,in that i like to add/insert chunk data into that file.
chunk is block of data to be dispalyed in the image .
 
Please help in this regards
 

Thanks
Posted 24-Apr-12 20:02pm
Roja_25290
Comments
enhzflep at 25-Apr-12 1:48am
   
Can you elaborate on what you mean by "add/insert chunk data"?
Do you mean you'd like to copy another smaller image into the image in question?
 
If so - load image, create compatible DC, select image into DC, bitblt other image into desired position.
Jedson at 25-Apr-12 2:08am
   
adding/insert chunk means like to add text/label into the image

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

PNG does support comment / text chunks. but, there is no mechanism in the PNG spec to tell a reader how to display that text. and you could probably define your own custom chunk type, if you have non-ASCII data to store. but again, there is nothing to tell viewers how to display your data.
  Permalink  
Comments
Tony Joy at 26-Apr-12 0:36am
   
what is the solution to add an extra chunk in the image?can you tell me how to define own custom chunk type ?
Chris Losinger at 26-Apr-12 7:38am
   
you can use a tool like pngsplit to insert a custom chunk into an existing image. to add a new chunk to an image while you're writing it, use png_write_chunk (after png_write_info, IIRC).
Tony Joy at 26-Apr-12 9:18am
   
can you brief more about this in which file to be added ?
Chris Losinger at 26-Apr-12 9:38am
   
i'm assuming you're using pngLib to create your PNG file. so, you would do the png_write_chunk wherever you are doing all the other libPng stuff.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 420
1 OriginalGriff 230
2 DamithSL 175
3 Dave Kreskowiak 120
4 Zoltán Zörgő 114
0 OriginalGriff 7,740
1 DamithSL 5,644
2 Sergey Alexandrovich Kryukov 5,404
3 Maciej Los 5,011
4 Kornfeld Eliyahu Peter 4,539


Advertise | Privacy | Mobile
Web02 | 2.8.141223.1 | Last Updated 25 Apr 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100