Thread: Loading bitmaps with createfile() +CreateDIBSection

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #6
    Registered User
    Join Date
    Aug 2003
    Posts
    23
    lol, LoadImage & LoadBitmap don't work for me either I don't know how to use resources!?

    Benny thanks for that, I will take a look at it. The CreateFile, CreateFileMapping and MapViewOfFile do exactly (I think) , the same thing, -returns a pointer to the start of the file, except with this, windows looks after the memory management etc.

    I was having a problem trying to get to the Header files, how to read them,- where are they? but I think I've got it now.
    Do you have to do the SetDIBits part? My book "Graphics programming in C++" (for windows) -Mark Walmsley, doesn't have that in it at all, it does say though, that the last two params of CreateDiBSection, "cause the file image bits to be incorporated into the new bitmap".- I presume that would mean the file you have just loaded?

    In case you might find it useful CreateDiBSection() allows you to get a pointer to the actual pixels, so you can change them/do things with them.

    On the subject of loading/reading files, does this mean you could do something similar with any type of file? I got really confused with the whole bit, but being able to read files like this could be quite useful. Have you any tips on the best ways to do it.
    Last edited by Stevo; 05-13-2004 at 03:48 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem Loading Bitmaps in Allegro
    By LiNeAr in forum Game Programming
    Replies: 1
    Last Post: 08-15-2005, 04:12 PM
  2. MapViewOfFile and CreateDIBSection problem with bitmaps
    By LuckY in forum Windows Programming
    Replies: 2
    Last Post: 08-18-2004, 08:37 AM
  3. Loading bitmaps without win32
    By /Muad'Dib\ in forum C++ Programming
    Replies: 0
    Last Post: 04-05-2004, 02:47 PM
  4. Loading Bitmaps
    By Neandrake in forum Windows Programming
    Replies: 4
    Last Post: 12-17-2001, 01:50 AM
  5. Loading Resource Bitmaps
    By Xterria in forum Windows Programming
    Replies: 10
    Last Post: 11-11-2001, 01:12 PM