How to load mutiple images into MDI??

Hi every body, thanks for see my topic.

My problem is =>
" I had an application to load multiple images/bitmap into MDI. For examples: I have 5 images, when i load them to my MDI(window) after that my application will generate 5 MDI(5 windows) that will contain 5 images(each window contain 1 image). "

 Please, help me!!I'm a newbabie :D
Thanks so much for send mail: tranducmille@gmail.com
lieunguyenhoaAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mahesh1402IT ProfessionalCommented:
so what you want to do ? want to load them all in one window or just load them in individual ?
lieunguyenhoaAuthor Commented:
' so what you want to do ? want to load them all in one window or just load them in individual ?

Hi Mahesh!
I want to load them all in one window, maybe it will be separated in each page.
Please, see my demo:
http://my.opera.com/tranducmille/homes/albums/52581/1untitled.JPG

Please, help me.
THanks so much
mahesh1402IT ProfessionalCommented:
Link is not opening.

Ok ..

>> want to load them all in one window,

well then you may use same code I have given you in my last post of your last question. .. You just need to BitBlt() on your WM_PAINT handler function. As this time you need to load multiple images that means you need multiple BitBlt().

>>maybe it will be separated in each page.

Dont know what do you mean by seperted in each page... You need to seperate by fixed distance or according to your print page.
You can change 'Y' in BitBlt() function to blit image in y dimensions.


MAHESH
OWASP: Forgery and Phishing

Learn the techniques to avoid forgery and phishing attacks and the types of attacks an application or network may face.

lieunguyenhoaAuthor Commented:
Dear MAHESH !

>>As this time you need to load multiple images that means you need multiple BitBlt().

These images will be loaded from a file dialogbox, so that i can't used it with multiple BitBlt().

>>You need to seperate by fixed distance or according to your print page.

How to implement it ??

MAHESH, sorry about my VC++ language, i'm a beginner so i can't write hard codes.
Please help me!

I think link is opening and done well.
Thanks
mahesh1402IT ProfessionalCommented:
>>These images will be loaded from a file dialogbox, so that i can't used it with multiple BitBlt().

It seems you have not looked into code I have given you.. BitBlt() is used to load bitmap from BMP file only using LoadImage().

You just need following code on you WM_PAINT message handler (OnPaint).

void CMyDlg::OnPaint()
{                              
                                CPaintDC dc(this);
            HDC            hMemDC;
            HBITMAP oldBmp;
            BITMAP      bm;

                               //Just pass file name selected from File Dialog Box instead of  'c:\\test.bmp'
            hBmpThumb = (HBITMAP)LoadImage( NULL,"C:\\test.bmp", IMAGE_BITMAP, 0, 0,LR_CREATEDIBSECTION | LR_DEFAULTSIZE | LR_LOADFROMFILE );

            hMemDC = CreateCompatibleDC( dc.GetSafeHdc());
            GetObject(m_hBmpThumb, sizeof(BITMAP), &bm );
            oldBmp = (HBITMAP)SelectObject( hMemDC, hBmpThumb );

            BitBlt( dc.GetSafeHdc(), 0, 0,bm.bmWidth ,bm.bmHeight, hMemDC, 0, 0, SRCCOPY );
            
            SelectObject( hMemDC, oldBmp );
            
            DeleteObject( oldBmp );
            DeleteObject( hMemDC );

            CDialog::OnPaint();
}

MAHESH

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
lieunguyenhoaAuthor Commented:
- Thanks for your answer, i done it.
and now:
 >> How could i calculate height/width of a page or an image. If "size of image" more than "size of page"=> cut part of left(image) and paste it into page 2.
How do it? THanks so much.
mahesh1402IT ProfessionalCommented:
size of page <== in what terms ? Printer Page ?

-MAHESH
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.