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. The Lounge
  3. Loading jpg image using openGL

Loading jpg image using openGL

Scheduled Pinned Locked Moved The Lounge
tutorialgraphicsgame-dev
21 Posts 16 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.
  • J Offline
    J Offline
    jagannathan thiruvengadathan
    wrote on last edited by
    #1

    Hello friend, Have a great day!. Could you please guide me, how to load the .jpg image file using openGL. Awaiting for your reply. Regards, Jagan

    C S N M A 9 Replies Last reply
    0
    • J jagannathan thiruvengadathan

      Hello friend, Have a great day!. Could you please guide me, how to load the .jpg image file using openGL. Awaiting for your reply. Regards, Jagan

      C Offline
      C Offline
      code frog 0
      wrote on last edited by
      #2

      Microsoft Photo, Fax & Picture Viewer on a system with an OpenGL video card. Right? Just get the right video card and open the picture. :laugh:

      L 1 Reply Last reply
      0
      • J jagannathan thiruvengadathan

        Hello friend, Have a great day!. Could you please guide me, how to load the .jpg image file using openGL. Awaiting for your reply. Regards, Jagan

        S Offline
        S Offline
        Sarath C
        wrote on last edited by
        #3

        Did you notice Got a Programming Question? Click here! heading just top of the threads?

        -Sarath. "Great hopes make everything great possible" - Benjamin Franklin

        My blog - Sharing My Thoughts, An Article - Understanding Statepattern

        C 1 Reply Last reply
        0
        • S Sarath C

          Did you notice Got a Programming Question? Click here! heading just top of the threads?

          -Sarath. "Great hopes make everything great possible" - Benjamin Franklin

          My blog - Sharing My Thoughts, An Article - Understanding Statepattern

          C Offline
          C Offline
          code frog 0
          wrote on last edited by
          #4

          Of course he noticed it. Just like I did. He wants an answer to his question. I think from now on all PQ's should get an answer just not the one they are looking for nor any mention of them being in the wrong place. If they really need help and posted in the wrong place they'll figure it out in time. :laugh:

          R L 2 Replies Last reply
          0
          • C code frog 0

            Of course he noticed it. Just like I did. He wants an answer to his question. I think from now on all PQ's should get an answer just not the one they are looking for nor any mention of them being in the wrong place. If they really need help and posted in the wrong place they'll figure it out in time. :laugh:

            R Offline
            R Offline
            Russell Morris
            wrote on last edited by
            #5

            code-frog wrote:

            I think from now on all PQ's should get an answer just not the one they are looking for nor any mention of them being in the wrong place.

            Dear lord - are you suggesting a CListCtrl-bot?

            -- Russell Morris Morbo: "WINDMILLS DO NOT WORK THAT WAY!"

            C 1 Reply Last reply
            0
            • R Russell Morris

              code-frog wrote:

              I think from now on all PQ's should get an answer just not the one they are looking for nor any mention of them being in the wrong place.

              Dear lord - are you suggesting a CListCtrl-bot?

              -- Russell Morris Morbo: "WINDMILLS DO NOT WORK THAT WAY!"

              C Offline
              C Offline
              code frog 0
              wrote on last edited by
              #6

              I think that Maunder is trying to implement that right now. Right? How else is he able to take his millions of emails down to thousands and so-on? It should be doable for sure. Let's get it into the suggestion forum for peer-review. Code-walk-thru in 3 days. If we write it we need 7 if Shog writes it he needs 1 day and a six pack of beer, 1 onion, some beef fillets and some quiet time in his kitchen. It's all good.

              1 Reply Last reply
              0
              • J jagannathan thiruvengadathan

                Hello friend, Have a great day!. Could you please guide me, how to load the .jpg image file using openGL. Awaiting for your reply. Regards, Jagan

                N Offline
                N Offline
                NormDroid
                wrote on last edited by
                #7

                Yeah use a can opener.

                WPF - Imagineers Wanted Follow your nose using DoubleAnimationUsingPath

                1 Reply Last reply
                0
                • C code frog 0

                  Microsoft Photo, Fax & Picture Viewer on a system with an OpenGL video card. Right? Just get the right video card and open the picture. :laugh:

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

                  code-frog wrote:

                  Just get the right video card and open the picture

                  I tried that and snapped the corner of the PCB off when I wedged it in the photo frame! So much for MaxForce, I only used a couple of kilos of pressure!

                  Morality is indistinguishable from social proscription

                  1 Reply Last reply
                  0
                  • J jagannathan thiruvengadathan

                    Hello friend, Have a great day!. Could you please guide me, how to load the .jpg image file using openGL. Awaiting for your reply. Regards, Jagan

                    M Offline
                    M Offline
                    Malcolm Smart
                    wrote on last edited by
                    #9

                    In future, if you post programmnig questions in the lounge, please make sure you mark it for the Attention of Peter O'Hanlon, in the subject line. That will ensure we have at least one quality post in the lounge and saves us the time of ridiculing you personally.

                    Small angry dogs

                    P 1 Reply Last reply
                    0
                    • J jagannathan thiruvengadathan

                      Hello friend, Have a great day!. Could you please guide me, how to load the .jpg image file using openGL. Awaiting for your reply. Regards, Jagan

                      A Offline
                      A Offline
                      Abu Mami
                      wrote on last edited by
                      #10

                      jagannathan thiruvengadathan wrote:

                      the .jpg image

                      You say "the" .jpg image. Do you have a specific image in mind? You have to specify. Each image needs to be loaded differently. Some have to have the red pixels loaded first, others the transparent pixels, and so on. What you need to do is check the metadata of the picture to find out this information. Then once this is done, line up all the bits in the correct order single file since the input port is very narrow and they can only be loaded in single file. If you line them up side by side, some will get stuck at the sides of the input port and fall away into unused memory (memory leak). This will end up clogging up your memory and you'll have to use drano on your RAM to clean it out.

                      C 1 Reply Last reply
                      0
                      • A Abu Mami

                        jagannathan thiruvengadathan wrote:

                        the .jpg image

                        You say "the" .jpg image. Do you have a specific image in mind? You have to specify. Each image needs to be loaded differently. Some have to have the red pixels loaded first, others the transparent pixels, and so on. What you need to do is check the metadata of the picture to find out this information. Then once this is done, line up all the bits in the correct order single file since the input port is very narrow and they can only be loaded in single file. If you line them up side by side, some will get stuck at the sides of the input port and fall away into unused memory (memory leak). This will end up clogging up your memory and you'll have to use drano on your RAM to clean it out.

                        C Offline
                        C Offline
                        Christian Graus
                        wrote on last edited by
                        #11

                        Abu Mami wrote:

                        Some have to have the red pixels loaded first, others the transparent pixels, and so on.

                        JPEGs do not have transparency information, you're thinking of PNG

                        Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

                        A 1 Reply Last reply
                        0
                        • C Christian Graus

                          Abu Mami wrote:

                          Some have to have the red pixels loaded first, others the transparent pixels, and so on.

                          JPEGs do not have transparency information, you're thinking of PNG

                          Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

                          A Offline
                          A Offline
                          Abu Mami
                          wrote on last edited by
                          #12

                          Christian Graus wrote:

                          JPEGs do not have transparency information,

                          You're right of course. That certainly changes the entire method that I described. Not sure how that affects the input port and the requirement for lining up the pixels in single file. Looks like I'll have to rethink this.

                          Christian Graus wrote:

                          you're thinking of PNG

                          Actually, I wasn't thinking of anything. At the time, my mind was stuffed with transparent pixels.

                          1 Reply Last reply
                          0
                          • J jagannathan thiruvengadathan

                            Hello friend, Have a great day!. Could you please guide me, how to load the .jpg image file using openGL. Awaiting for your reply. Regards, Jagan

                            P Offline
                            P Offline
                            Pete OHanlon
                            wrote on last edited by
                            #13

                            Before I get round to mocking you, I'll save you a little time - this is the lounge, where the demigods strut their stuff posing philosophical questions that mere mortals such as yourself could not hope to understand. Here in the lounge, we are all genius supermodels and if you can't live up to our high standards, then you had better have your fireproof underwear on because your ass is going to get mighty hot as the flames lick away at your fundamentals. I know that you aren't one of the beautiful people because we all know that you don't ask programming questions in the lounge, so I can only assume that you are one of the usual lazy, ugly troglodyte types who occassionally wander in wearing that gazelle near the waterhole look while the Lions are sitting nearby. Obviously, we are much smarter than you. If you want a comparison then imagine that our brains are the size of Jupiter and that yours is the size of something really really small (say your brain). It's obvious from this that you aren't likely to be winning any smart awards.

                            Deja View - the feeling that you've seen this post before.

                            My blog | My articles

                            A J 2 Replies Last reply
                            0
                            • M Malcolm Smart

                              In future, if you post programmnig questions in the lounge, please make sure you mark it for the Attention of Peter O'Hanlon, in the subject line. That will ensure we have at least one quality post in the lounge and saves us the time of ridiculing you personally.

                              Small angry dogs

                              P Offline
                              P Offline
                              Pete OHanlon
                              wrote on last edited by
                              #14

                              Malcolm Smart wrote:

                              if you post programmnig questions in the lounge, please make sure you mark it for the Attention of Peter O'Hanlon, in the subject line.

                              :laugh: I seem to have some sort of reputation.

                              Deja View - the feeling that you've seen this post before.

                              My blog | My articles

                              1 Reply Last reply
                              0
                              • J jagannathan thiruvengadathan

                                Hello friend, Have a great day!. Could you please guide me, how to load the .jpg image file using openGL. Awaiting for your reply. Regards, Jagan

                                F Offline
                                F Offline
                                Francois Gasnier
                                wrote on last edited by
                                #15

                                You first need to load the jpg using gdi+, then get a pointer to pixel buffer, do some work on it and create an opengl texture based on the reworked buffer. Use google and chek algorithm that deals with texture resizing.

                                ___________________________________________________________ On the whole human beings want to be good, but not to good and not quite all the time - George Orwell

                                1 Reply Last reply
                                0
                                • P Pete OHanlon

                                  Before I get round to mocking you, I'll save you a little time - this is the lounge, where the demigods strut their stuff posing philosophical questions that mere mortals such as yourself could not hope to understand. Here in the lounge, we are all genius supermodels and if you can't live up to our high standards, then you had better have your fireproof underwear on because your ass is going to get mighty hot as the flames lick away at your fundamentals. I know that you aren't one of the beautiful people because we all know that you don't ask programming questions in the lounge, so I can only assume that you are one of the usual lazy, ugly troglodyte types who occassionally wander in wearing that gazelle near the waterhole look while the Lions are sitting nearby. Obviously, we are much smarter than you. If you want a comparison then imagine that our brains are the size of Jupiter and that yours is the size of something really really small (say your brain). It's obvious from this that you aren't likely to be winning any smart awards.

                                  Deja View - the feeling that you've seen this post before.

                                  My blog | My articles

                                  A Offline
                                  A Offline
                                  Anton Afanasyev
                                  wrote on last edited by
                                  #16

                                  Pete O'Hanlon wrote:

                                  If you want a comparison then imagine that our brains are the size of Jupiter and that yours is the size of something really really small (say your brain)

                                  :-D:laugh:;P

                                  :badger:

                                  1 Reply Last reply
                                  0
                                  • J jagannathan thiruvengadathan

                                    Hello friend, Have a great day!. Could you please guide me, how to load the .jpg image file using openGL. Awaiting for your reply. Regards, Jagan

                                    M Offline
                                    M Offline
                                    marky777
                                    wrote on last edited by
                                    #17

                                    Firstly, recover from the obvious brain damage you have sustained. Secondly, read warnings before you post queries. M

                                    A 1 Reply Last reply
                                    0
                                    • C code frog 0

                                      Of course he noticed it. Just like I did. He wants an answer to his question. I think from now on all PQ's should get an answer just not the one they are looking for nor any mention of them being in the wrong place. If they really need help and posted in the wrong place they'll figure it out in time. :laugh:

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

                                      Darwin?

                                      Visit http://www.notreadytogiveup.com/[^] and do something special today.

                                      1 Reply Last reply
                                      0
                                      • P Pete OHanlon

                                        Before I get round to mocking you, I'll save you a little time - this is the lounge, where the demigods strut their stuff posing philosophical questions that mere mortals such as yourself could not hope to understand. Here in the lounge, we are all genius supermodels and if you can't live up to our high standards, then you had better have your fireproof underwear on because your ass is going to get mighty hot as the flames lick away at your fundamentals. I know that you aren't one of the beautiful people because we all know that you don't ask programming questions in the lounge, so I can only assume that you are one of the usual lazy, ugly troglodyte types who occassionally wander in wearing that gazelle near the waterhole look while the Lions are sitting nearby. Obviously, we are much smarter than you. If you want a comparison then imagine that our brains are the size of Jupiter and that yours is the size of something really really small (say your brain). It's obvious from this that you aren't likely to be winning any smart awards.

                                        Deja View - the feeling that you've seen this post before.

                                        My blog | My articles

                                        J Offline
                                        J Offline
                                        JudyL_MD
                                        wrote on last edited by
                                        #19

                                        Now that got the morning off to a great start! :laugh: :laugh: I do so love the ability to insult someone while remaining exquisitely polite. Judy

                                        1 Reply Last reply
                                        0
                                        • M marky777

                                          Firstly, recover from the obvious brain damage you have sustained. Secondly, read warnings before you post queries. M

                                          A Offline
                                          A Offline
                                          Alaric_
                                          wrote on last edited by
                                          #20

                                          ok....first, this is in the wrong location. Note this fact, and don't post this kind of stuff in the lounge again or someone like me will not come along to help....although I'm not going to provide full help. ....Mostly, because this post is in the wrong spot lol. OpenGL doesn't have any intrinsic functions build into the fixed-function pipeline for loading jpegs. You have to manually parse them yourself using jpeg loading techniques that you would use in any program that you would want to load a jpeg(not just OpenGL) ....I would suggest loading the jpeg into memory, procedurally generating a texture from this in-memory image, and mapping it to a 2D quad that is in the same orientation as the screen. Boom....jpeg ....Try looking at the C# message board for a thread that was composed on July 2, 2007. You'll get your answer.

                                          "I need build Skynet. Plz send code"

                                          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