DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: array to picture api

  1. #1
    Mike Guest

    array to picture api


    Hi I've got an array with a picture in it. Each array-element has a value
    btw. 0 and 255, which is the color-information for that pixel. It's easy
    to plot using pset and setpixel(api) but theyre both VERY slow. I'd like
    to use bitblt, but can't find out how to get a handle to my array. Any help
    appreciated. What I need is a short and fast way to "copy" a 2-dim. array
    to a picture-box or form.picture.
    Thanks

  2. #2
    Michael Shutt Guest

    Re: array to picture api

    You may want to checkout the SetDIBits function. It will let you copy a DIB
    (sounds like that's what you've got) to a destination device context (your
    picturebox). You would fill out a BITMAPINFO structure that describes your
    array of data and then pass a pointer to the beginning of the array as the
    lpvBits parameter. I haven't done this myself, but it should be very
    straight forward.

    --
    Michael Shutt

    Please respond to newsgroup as I will not return direct emails.

    "Mike" <mkbarry@physik.unizh.ch> wrote in message
    news:3c5aa386$1@10.1.10.29...
    >
    > Hi I've got an array with a picture in it. Each array-element has a value
    > btw. 0 and 255, which is the color-information for that pixel. It's easy
    > to plot using pset and setpixel(api) but theyre both VERY slow. I'd like
    > to use bitblt, but can't find out how to get a handle to my array. Any

    help
    > appreciated. What I need is a short and fast way to "copy" a 2-dim. array
    > to a picture-box or form.picture.
    > Thanks




  3. #3
    Michael Shutt Guest

    Re: array to picture api

    You may want to checkout the SetDIBits function. It will let you copy a DIB
    (sounds like that's what you've got) to a destination device context (your
    picturebox). You would fill out a BITMAPINFO structure that describes your
    array of data and then pass a pointer to the beginning of the array as the
    lpvBits parameter. I haven't done this myself, but it should be very
    straight forward.

    --
    Michael Shutt

    Please respond to newsgroup as I will not return direct emails.

    "Mike" <mkbarry@physik.unizh.ch> wrote in message
    news:3c5aa386$1@10.1.10.29...
    >
    > Hi I've got an array with a picture in it. Each array-element has a value
    > btw. 0 and 255, which is the color-information for that pixel. It's easy
    > to plot using pset and setpixel(api) but theyre both VERY slow. I'd like
    > to use bitblt, but can't find out how to get a handle to my array. Any

    help
    > appreciated. What I need is a short and fast way to "copy" a 2-dim. array
    > to a picture-box or form.picture.
    > Thanks




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center