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

P

Patrick

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
 
J

John Harrison

Patrick said:
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
john
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top