home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.ms-windows.programmer.misc
- Path: sparky!uunet!wupost!eclnews!swarm.wustl.edu!wilcox
- From: wilcox@swarm.wustl.edu (Don Wilcox)
- Subject: Re: StretchDIBits and one other question...
- Message-ID: <1992Sep14.185010.11032@wuecl.wustl.edu>
- Sender: usenet@wuecl.wustl.edu (Usenet Administrator)
- Nntp-Posting-Host: swarm
- Organization: Washington University in St. Louis, MO
- References: <1992Sep13.231220.686@twisto.eng.hou.compaq.com>
- Date: Mon, 14 Sep 1992 18:50:10 GMT
- Lines: 37
-
- In article <1992Sep13.231220.686@twisto.eng.hou.compaq.com> mccreary@sword.eng.hou.compaq.com (Ed McCreary) writes:
- >I'm having an odd problem with StretchDIBits (and SetDIBitsToDevice also.)
- >
- >... Now it works fine with
- >images with dimensions of 200x200 and 800x800, but when I try 130x130
- >or 255x210 it fails. It returns 0 meaning 0 lines displayed.
- >
-
- I got my code working about a year ago, so my memory on the exact backflips
- required is a little sketchy, but I seem to remember having to make be DIB a
- multiple of 2, or 4. The sizes given to StretchDIBits could be anything, but
- the actual image had these constraints (I think).
-
- >
- >The second question is with how to store the image data in memory.
- >This works fine and I can access the data sequentially, say
- >
- > char huge *ptr;
- > ptr = (char huge *)GlobalLock(hImageBits);
- > for(i=0;i<40000;i++)
- > ptr++; // for a 200x200 image.
- >
- >this works fine. The problem occurs when I try to access a byte
- >in the middle. ptr+=20000 directly instead of moving through all of
- >the data. Is this a problem with the way I'm trying to access
- >the memory or do I need to rethink the way I store it.
- >
- I have no problems doing what you describe. I use BC++, and have the "fast
- huge pointers" option enabled. Could this be your problem? Other than that,
- I don't see a problem.
-
- Don
-
- --
- Don Wilcox | "For I am not ashamed of the Gospel of
- Washington University in St. Louis | Christ, for it is the power of salvation
- email: wilcox@swarm.wustl.edu | to all who believe."
-