home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / os / mswindo / programm / misc / 1832 < prev    next >
Encoding:
Text File  |  1992-09-14  |  2.0 KB  |  50 lines

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