Results 1 to 17 of 17

Thread: Loading bitmaps...

  1. #1

    Thread Starter
    Frenzied Member CyberCarsten's Avatar
    Join Date
    Sep 1999
    Location
    Aalborg Ø, Denmark
    Posts
    1,544

    Loading bitmaps...

    Hi all!
    I'm trying to load a 256 color bitmap with the following code, but it doesn't look good at all! The bitmap is painted over the system bar and has two black lines going throug it....was it wrong...???


    Any help would be appriciated!

    BTW: Is there an esiaer way to do it??
    Attached Files Attached Files
    Last edited by CyberCarsten; Sep 25th, 2002 at 10:17 AM.
    razor
    Software Engineer Student, Aalborg University, Denmark
    http://www.cs.auc.dk

    My email at AUC: will get a new email soon
    My website: http://www.razorsoftware.net


    Windows XP Pro/ Gentoo Linux (Laptop)
    Windows XP Pro (Home PC)

  2. #2
    Fanatic Member Mushroom Realm's Avatar
    Join Date
    Mar 2002
    Location
    Murrieta, California
    Posts
    650
    u could use use loadpicture.

    oops, didnt see it was c++, ud have to use loadbitmap(). check it out at www.winprog.org
    Last edited by Mushroom Realm; Sep 25th, 2002 at 03:29 PM.

  3. #3
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Hehe, Mushroom You didn't even look at the post did ya

    Carsten, the way I look at it is you have two choices - now I know I suck at C++, and you might not, but check every little detail in the loading section. You'll be surprised at the stuff you missed yesterday that you won't, for example, today.

    The other thing I can think of is loading using DirectDraw's internal bitmap loader. Just look up a DirectX resource site and implement its way of loading. It should work for 8-bit bitmaps with a flag.

    That's all I can think of, I hope you figure it out! Best of luck!
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  4. #4
    Fanatic Member Mushroom Realm's Avatar
    Join Date
    Mar 2002
    Location
    Murrieta, California
    Posts
    650
    My internet is so slow that i try not to download something unless i really have to.

  5. #5
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Too bad
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  6. #6

    Thread Starter
    Frenzied Member CyberCarsten's Avatar
    Join Date
    Sep 1999
    Location
    Aalborg Ø, Denmark
    Posts
    1,544
    Thanks guys!
    razor
    Software Engineer Student, Aalborg University, Denmark
    http://www.cs.auc.dk

    My email at AUC: will get a new email soon
    My website: http://www.razorsoftware.net


    Windows XP Pro/ Gentoo Linux (Laptop)
    Windows XP Pro (Home PC)

  7. #7

    Thread Starter
    Frenzied Member CyberCarsten's Avatar
    Join Date
    Sep 1999
    Location
    Aalborg Ø, Denmark
    Posts
    1,544
    But there is something wrong....I can load a 640x480 picture just fine, but when I load a smaller one, it goes berskerk...???
    razor
    Software Engineer Student, Aalborg University, Denmark
    http://www.cs.auc.dk

    My email at AUC: will get a new email soon
    My website: http://www.razorsoftware.net


    Windows XP Pro/ Gentoo Linux (Laptop)
    Windows XP Pro (Home PC)

  8. #8
    Fanatic Member MoMad's Avatar
    Join Date
    Oct 2000
    Location
    Seattle, WA
    Posts
    625
    Huh??? Hmm, Ill take a look at it and see where the problem is
    :MoMad:
    Nice Sig!

    http://go.to/momad/ Status: Not Ready

  9. #9
    Fanatic Member MoMad's Avatar
    Join Date
    Oct 2000
    Location
    Seattle, WA
    Posts
    625
    Your code does some weird stuff, my only guess is that your other bitmaps are perhaps less than 8bits. Make sure all your bitmaps are 8bit or 16 bit. Other than that, I would suggest you use the DDLoadBitmap function in the ddutil.h file that comes with DirectX SDK.
    :MoMad:
    Nice Sig!

    http://go.to/momad/ Status: Not Ready

  10. #10

    Thread Starter
    Frenzied Member CyberCarsten's Avatar
    Join Date
    Sep 1999
    Location
    Aalborg Ø, Denmark
    Posts
    1,544
    Thanks
    Does it work in the same way?
    razor
    Software Engineer Student, Aalborg University, Denmark
    http://www.cs.auc.dk

    My email at AUC: will get a new email soon
    My website: http://www.razorsoftware.net


    Windows XP Pro/ Gentoo Linux (Laptop)
    Windows XP Pro (Home PC)

  11. #11
    Fanatic Member MoMad's Avatar
    Join Date
    Oct 2000
    Location
    Seattle, WA
    Posts
    625
    It works better man, it can load any number of bits per pixel and i think it will convert it for you... anyways, it returns a directdrawsurface object so you dont have to worry about all of the nasty bitmap loading functions, it does that all.
    :MoMad:
    Nice Sig!

    http://go.to/momad/ Status: Not Ready

  12. #12

    Thread Starter
    Frenzied Member CyberCarsten's Avatar
    Join Date
    Sep 1999
    Location
    Aalborg Ø, Denmark
    Posts
    1,544
    Great! Of so glad that I finally can get rid of all those nasty functions!
    Thanks
    razor
    Software Engineer Student, Aalborg University, Denmark
    http://www.cs.auc.dk

    My email at AUC: will get a new email soon
    My website: http://www.razorsoftware.net


    Windows XP Pro/ Gentoo Linux (Laptop)
    Windows XP Pro (Home PC)

  13. #13

    Thread Starter
    Frenzied Member CyberCarsten's Avatar
    Join Date
    Sep 1999
    Location
    Aalborg Ø, Denmark
    Posts
    1,544
    I can't find the function....
    razor
    Software Engineer Student, Aalborg University, Denmark
    http://www.cs.auc.dk

    My email at AUC: will get a new email soon
    My website: http://www.razorsoftware.net


    Windows XP Pro/ Gentoo Linux (Laptop)
    Windows XP Pro (Home PC)

  14. #14
    Fanatic Member MoMad's Avatar
    Join Date
    Oct 2000
    Location
    Seattle, WA
    Posts
    625
    Here is my functions:

    just #include the .h and make sure to change the .cpp to include the following:

    <ddraw.h>
    <windows.h>

    and anything else it might need, the stdhdr.h file is a precompiled header that contained all of those plus more stuff not specific to directdraw...
    Attached Files Attached Files
    :MoMad:
    Nice Sig!

    http://go.to/momad/ Status: Not Ready

  15. #15

    Thread Starter
    Frenzied Member CyberCarsten's Avatar
    Join Date
    Sep 1999
    Location
    Aalborg Ø, Denmark
    Posts
    1,544
    Uhhh very confusin code...could you give an example....
    razor
    Software Engineer Student, Aalborg University, Denmark
    http://www.cs.auc.dk

    My email at AUC: will get a new email soon
    My website: http://www.razorsoftware.net


    Windows XP Pro/ Gentoo Linux (Laptop)
    Windows XP Pro (Home PC)

  16. #16
    Fanatic Member MoMad's Avatar
    Join Date
    Oct 2000
    Location
    Seattle, WA
    Posts
    625
    Heheh, lol

    OK
    PHP Code:
    #include "ddutil.h"

    LPDIRECTDRAWSURFACE ThePic;

    // lpDD is pointer to DirectDraw object
    ThePic DDLoadBitmap (lpDD"MyPic.bmp"00);

    // Now ThePic contains the surface that holds mypic.bmp
    // you can blit and whatnot, bla bla bla 
    :MoMad:
    Nice Sig!

    http://go.to/momad/ Status: Not Ready

  17. #17

    Thread Starter
    Frenzied Member CyberCarsten's Avatar
    Join Date
    Sep 1999
    Location
    Aalborg Ø, Denmark
    Posts
    1,544
    Thanks!
    razor
    Software Engineer Student, Aalborg University, Denmark
    http://www.cs.auc.dk

    My email at AUC: will get a new email soon
    My website: http://www.razorsoftware.net


    Windows XP Pro/ Gentoo Linux (Laptop)
    Windows XP Pro (Home PC)

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