Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. PNG's and GDI+

PNG's and GDI+

Scheduled Pinned Locked Moved C / C++ / MFC
winformsgraphicshelptutorial
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    VCsamir
    wrote on last edited by
    #1

    hi friends, i have a small problem, i just want to know how to differentiate between the png images which are having some transparent area and which are without transparent area. Can this be a solution: "pixel by pixel scan the image and check the alpha value of each pixel" Is there any other way of handling the same. i am using GDI+ for the above. Thanking in Advance Samir Satardekar

    L 1 Reply Last reply
    0
    • V VCsamir

      hi friends, i have a small problem, i just want to know how to differentiate between the png images which are having some transparent area and which are without transparent area. Can this be a solution: "pixel by pixel scan the image and check the alpha value of each pixel" Is there any other way of handling the same. i am using GDI+ for the above. Thanking in Advance Samir Satardekar

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Hi Samir, The PNG image has an image header called the IHDR chunk. It contains a single BYTE 'Color Type' value and will be 4 or 6 if the PNG image supports alpha transparency. You can either read this value manually or use GDI+ to read this value. The Image::GetFlags method[^] will return a ImageFlagsHasAlpha value[^] if the image supports transparency. Best Wishes, -David Delaune

      V 1 Reply Last reply
      0
      • L Lost User

        Hi Samir, The PNG image has an image header called the IHDR chunk. It contains a single BYTE 'Color Type' value and will be 4 or 6 if the PNG image supports alpha transparency. You can either read this value manually or use GDI+ to read this value. The Image::GetFlags method[^] will return a ImageFlagsHasAlpha value[^] if the image supports transparency. Best Wishes, -David Delaune

        V Offline
        V Offline
        VCsamir
        wrote on last edited by
        #3

        Thanks Sir David.. :) it really helped me.. thanks for being kind... :-D Regards Samir

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups