std::vector show as a bitmap with VC++

Discussion in 'C++' started by Patrick, Oct 15, 2004.

  1. Patrick

    Patrick Guest

    Hi

    I have an integer vector std::vector filled with data of an image.
    How can I show it on the screen.I know the size of the picture. I'm using
    VC++ 6. Thanks in advance.

    CU
    Patrick
    Patrick, Oct 15, 2004
    #1
    1. Advertising

  2. "Patrick" <> wrote in message
    news:cko6nk$q2j$...
    > Hi
    >
    > I have an integer vector std::vector filled with data of an image.
    > How can I show it on the screen.I know the size of the picture. I'm using
    > VC++ 6. Thanks in advance.
    >
    > CU
    > Patrick




    Assuming your vector is call vec and is a one dimensional vector, then
    &vec[0] will give you a pointer to the start of the image.
    vec.size()*sizeof<T> will give you the size of the image (where T is the
    type of your vector elements). Now, assuming your vector is formatted
    correctly, you can just pass these values to whatever Windows API calls are
    used to display a bitmap.

    If you meant to ask how to display a bitmap in Windows then the correct
    place for that would be news:comp.os.ms-windows.programmer.win32

    john
    John Harrison, Oct 15, 2004
    #2
    1. Advertising

  3. > vec.size()*sizeof<T>

    vec.size()*sizeof(T)

    john
    John Harrison, Oct 15, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Anonymous
    Replies:
    20
    Views:
    4,252
    Pete Becker
    Mar 30, 2005
  2. Gandalf

    Masked bitmap from bitmap

    Gandalf, Jan 29, 2004, in forum: Python
    Replies:
    0
    Views:
    553
    Gandalf
    Jan 29, 2004
  3. Jason Heyes
    Replies:
    8
    Views:
    703
    Andrew Koenig
    Jan 15, 2006
  4. Replies:
    8
    Views:
    1,873
    Csaba
    Feb 18, 2006
  5. Rune Allnor
    Replies:
    4
    Views:
    916
    Rune Allnor
    Dec 11, 2008
Loading...

Share This Page