Results 1 to 16 of 16

Thread: Png

  1. #1

    Thread Starter
    Hyperactive Member noble's Avatar
    Join Date
    Nov 2000
    Location
    Philly
    Posts
    471

    Png

    I'm trying to add PNG support to my program....

    i'm running into some difficulties using CxImage found on
    CodeProject.

    If anyone has knowledge of this or png support in general
    please let me know

    thank you in advance.
    Bababooey
    Tatatoothy
    Mamamonkey

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  3. #3

    Thread Starter
    Hyperactive Member noble's Avatar
    Join Date
    Nov 2000
    Location
    Philly
    Posts
    471
    i visited that website prior to coming here but i was unsure
    of how to take a png file from the HD and put it in a CStatic
    object

    do you have any experience with the png libraries?
    Bababooey
    Tatatoothy
    Mamamonkey

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    A bit, but CStatic is out of my domain (it's MFC, and I usually deal a bit lower level).

    I don't really have the time to re-work how to use libpng, sorry
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  5. #5

    Thread Starter
    Hyperactive Member noble's Avatar
    Join Date
    Nov 2000
    Location
    Philly
    Posts
    471
    np, thx anyways though
    Bababooey
    Tatatoothy
    Mamamonkey

  6. #6
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Probably best to load the png using libpng, then creating a DIBSection and filling with the data. It's a bit tricky, I'm doing the same thing at the moment (but I'll do JPEG first).
    MFC 7.0 has the CImage class which supports PNG nativly and converts it to a HBITMAP. You can easily convert that to CBitmap.
    Once you have a CBitmap you can insert it into a static control.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  7. #7

    Thread Starter
    Hyperactive Member noble's Avatar
    Join Date
    Nov 2000
    Location
    Philly
    Posts
    471
    is mfc 7.0 in .NET?
    Bababooey
    Tatatoothy
    Mamamonkey

  8. #8
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    MFC 7.0 is in VC++7, that is the one in VS.NET, but MFC is still not a part of .NET (it's the unmanaged class library, as opposed to the managed classes of .NET)
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  9. #9
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Originally posted by CornedBee
    MFC 7.0 is in VC++7, that is the one in VS.NET, but MFC is still not a part of .NET (it's the unmanaged class library, as opposed to the managed classes of .NET)
    I thought it was still 4.something? Hmm...have to look closer at the DLLs I think.

    I prefer the managed class library to MFC, I think (although I'm still waiting anxiously for the POSIX version )
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  10. #10
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    VC6 uses MFC 4 I think. It seems they have bumped up ("equalized" or "standardized") the version number.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  11. #11
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    "Managed classes" just sounds so TERRIBLY slow to me. And since I only use C++ I don't care whether I can use C++ classes in VB or not.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  12. #12
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Originally posted by CornedBee
    "Managed classes" just sounds so TERRIBLY slow to me. And since I only use C++ I don't care whether I can use C++ classes in VB or not.
    I probably wouldn't use either VB or C++ in .NET - if I needed to (i.e. suddenly at work they said, "stop using Irix and C++, we want you on .NET!", for whatever bizarre reason), then I'd use C# because it was designed to work with .NET.

    From the playing with it I did, it works quite well and I could adapt to it fairly quickly (someone paid attention to how C/C++ people think ).

    If you want garbage collection, then there are already frameworks for doing that. I think there's one on www.codeproject.com (the one by Bill Kempf, who, incidentally, is part of the Boost project that I'm trying to find user opinions of...)
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  13. #13
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Yeah, C# is probably best in .NET.
    I don't think I need garbage collection. I run into leaks very seldom.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  14. #14
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Once you've gained the experience (like you have) you tend to code in a way that inherently prevents them, so you won't have as many problems.

    I still like to encapsulate raw pointers inside classes though, because I get a bit absent-minded sometimes, hehe
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  15. #15

    Thread Starter
    Hyperactive Member noble's Avatar
    Join Date
    Nov 2000
    Location
    Philly
    Posts
    471
    do you recommend using C++ 7 or C#?

    i really like MFC but if windows forms are the way to go i'll
    consider trying it out
    Bababooey
    Tatatoothy
    Mamamonkey

  16. #16

    Thread Starter
    Hyperactive Member noble's Avatar
    Join Date
    Nov 2000
    Location
    Philly
    Posts
    471
    btw, i got the PNG support working, jpeg too
    Bababooey
    Tatatoothy
    Mamamonkey

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width