user3460211
user3460211

Reputation: 11

Display multiple images on dialog with data from file (C++ MFC)

I'm practice with MFC, but I have some problems.
Display a map render from txt file, like this:

4 4 //size_of_map
1 1 2 3
2 3 1 3
3 1 1 2
2 2 1 3

..with 1 = river image, 2 = tree image, 3 = rock image...
But I don't know how to display multiple images with Picture Control.
The map can resize by data input then I can't create 16 Picture Control.
How can I manage and create multiple images as number of input file?

Sorry for my bad english :)

Upvotes: 0

Views: 621

Answers (1)

xMRi
xMRi

Reputation: 15365

Don't use controls/windows for each picture. Use one view / window and handle the drawing in OnDraw/OnPaint.

Store all pictures in one image list. Use CImageList Draw to draw one image. You can easily use indexing to draw the imaged from the image list.

Upvotes: 1

Related Questions