Click here to Skip to main content
15,867,999 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
As you know,the png can display with the transparent.I want to display a png like itself in mirror.vertical or horizontal.

some body can help me? TKS :)
Posted
Updated 14-Dec-10 20:14pm
v2
Comments
[no name] 15-Dec-10 2:33am    
Why do you use png? bmp with 32 bit image is also good format. With this you can easy make pixel operations using lines (if you need do the task for many files).

1 solution

You could try to perform the following steps :) :

- Get the bitmap bits pointer of the image
- Get the height and width of the bitmap
- Get the bits-per-pixel ( BPP ) value of the bitmap
- Swap the pixels ( sizeof(pixel)=BPP/8 ) symmetrically on the lines or the columns
- Save the modified image

Do you have an access to the CImage class ? :)
 
Share this answer
 
v2
Comments
arvin_wuyanwen 15-Dec-10 2:27am    
I know how to draw the png mirror with the bitmap.
But when i load the png ,i get a iimage interface.And I can't access it's bmp soure data.So i must change it into IBimtmap interface ,and draw the Bitmap's mirror.If i draw the bitmap's mirror ,i lost the transparent propety(include alph).i get lost... But tks all the same...
Eugen Podsypalnikov 15-Dec-10 2:34am    
Have you already tried it ? :) :
{
CImage cImage;
if (S_OK == cImage.Load(_T("C:\\transp.png"))) {
void* pBits = cImage.GetBits();
if (pBits) {
//..
}
}
arvin_wuyanwen 15-Dec-10 3:10am    
I Work on Brew platform.And there's no CImage Class.So....I just tried to use the IBitmap interface to do it .But the transparent was gone.
Eugen Podsypalnikov 15-Dec-10 3:14am    
Understood. So you are looking for a library that provides the PNG-bits access, aren't you ? :)
arvin_wuyanwen 15-Dec-10 3:27am    
Bingo. Could you tell me how i can get a png lib with ansi c? or tell a way to do it in brew platform. Anybody cand do me a favour...TKS

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900