home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / bit / listserv / iamiga / 10522 < prev    next >
Encoding:
Text File  |  1993-01-21  |  1.7 KB  |  66 lines

  1. Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
  2. Path: sparky!uunet!paladin.american.edu!auvm!CENTRAL1.LANCASTER.AC.UK!MARTINK
  3. Via:            UK.AC.LANCS.CENT1; 21 JAN 93 10:42:12 GMT
  4. X-Mailer:       ELM [version 2.4 PL17]
  5. Content-Type:   text
  6. Content-Length: 1118
  7. Message-ID: <7775.9301211043@central1.lancaster.ac.uk>
  8. Newsgroups: bit.listserv.i-amiga
  9. Date:         Thu, 21 Jan 1993 10:43:39 +0000
  10. Sender:       Info-Amiga List <I-AMIGA@RUTVM1.BITNET>
  11. From:         Martin Kalugin <martink@CENTRAL1.LANCASTER.AC.UK>
  12. Subject:      Gadgets & images
  13. Lines: 51
  14.  
  15. Hi!
  16.  
  17. I need some assistance with C programming on the Amiga 500+.  I am trying
  18. to write a function called "CreateImage ()".  The synopsis looks like:
  19.  
  20.  
  21.         int     CreateImage (image_st_ptr, image_data, width, height, depth);
  22.  
  23.         struct  Image   *image_st_ptr;
  24.         UWORD   chip    *image_data;
  25.         int                             width, height, depth;
  26.  
  27.  
  28. The aim of the function is to take a pointer to an Image structure
  29. (image_st_ptr) fill in the relevant details (such as the image data, its width,
  30. height & depth).
  31.  
  32. After the function is called I call:
  33.  
  34.         DrawImage (window_1->RPort, &image_st, 50, 50);
  35.  
  36. But it displays a whole load of garbage!
  37.  
  38.  
  39.  
  40. I have tried simply filling in the structure at the same time as I declare it,
  41. Ie,
  42.  
  43. struct  Image image_st =
  44. {
  45.         0, 0, 16, 6, 2,
  46.         image_data,
  47.         0x03, 0x00, NULL
  48. };
  49.  
  50. And this displays the image just fine!!!
  51.  
  52.  
  53. Does anyone know what I could be doing wrong?
  54.  
  55. By the way I am declaring the image data in "chip" memory and I am using
  56. Lattice C 5.10.
  57.  
  58.  
  59. Please reply to:
  60. --
  61.                               Martin Kalugin
  62.  
  63.                            Phone: (0524) 593677
  64.  
  65.                      Email: M.Kalugin@uk.ac.lancaster
  66.