how to open a client window for bitmap ?

My intention is to open a new window without any menu for displaying a bitmap picture, which i want to create with the CPaintDC->setPixel command. My image data ist stored on heap. What is the best way to do this ?
alexottAsked:
Who is Participating?
 
Vinayak KumbarConnect With a Mentor Sr Program ManagerCommented:
Hi,

U know it already, U have to use SetPixel to do that. May be in a seperate thread.

Try it out.
VinExpert

NOTE : copy this comment 3 times :)
0
 
Vinayak KumbarSr Program ManagerCommented:
Hi,

Do like this.
1. Using classwizard create a new class say CMyWnd derived from CWnd.
2. say u want to pop up this window in xxxx.cpp, then go to xxxx.h and add the #include "MyWnd.h" to it.
3. Then add the public variable as
CMyWnd *pWnd;
4. In the xxxx.cpp file constructor do
pWnd = NULL;
5. Then whenever U want to pop it up do

CRect rect(10,10,200,200);
pWnd = new CMyWnd;
pWnd->Create(NULL, "MTV", WS_CHILD | WS_VISIBLE | WS_CAPTION | WS_SYSMENU, rect, this, 4545, NULL);
pWnd->ShowWindow(SW_SHOW);

6. U can map the WM messages to the CMyWnd class like WM_PAINT and handle them.

Try it out.
VinExpert
0
 
alexottAuthor Commented:
answer does not tell me anything about bitmaps and how to pu them into a new window
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
alexottAuthor Commented:
This question has a deletion request Pending
0
 
alexottAuthor Commented:
answer does noct tell me anything about how to put pixels into the new window
0
 
Vinayak KumbarSr Program ManagerCommented:
This question no longer is pending deletion
0
 
Vinayak KumbarSr Program ManagerCommented:
Hi,

U know it already, U have to use SetPixel to do that. May be in a seperate thread.

Try it out.
VinExpert

NOTE : copy this comment 3 times
0
 
OlivCommented:
Depends on the size of your bitmap but for me, SetPixel is sure not the best way to draw your bitmap : should rather use ::PaintDIB or something like that.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.