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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Patrick

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

    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


  • John Harrison

    #2
    Re: std::vector show as a bitmap with VC++


    "Patrick" <this.20.pako@s pamgourmet.com> wrote in message
    news:cko6nk$q2j $1@home.itg.ti. com...[color=blue]
    > 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[/color]



    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()*size of<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.program mer.win32

    john


    Comment

    • John Harrison

      #3
      Re: std::vector show as a bitmap with VC++

      > vec.size()*size of<T>

      vec.size()*size of(T)

      john


      Comment

      Working...