Table of Contents

 
PlaceImage
 

Purpose

Moves an image or many images to a new location

 

Protoype

void CImageMngr::PlaceImage (int i_new_x, int i_new_y, string str_img_id, exclude ex_list = exclude(), 
                             int i_flag = LIST_IN)
 

Parameters

new_x the new X position
new_y the new Y position
img_id the ID of the image to move, ALL_IMAGES if moving more than one image object
list the list of image objects to exclude or include in function
flag whether to exclude objects not in the list (LIST_OUT) or objects in the list (LIST_IN)
 

Description

This function places image objects at the coordinates given. So if an image object is located at (100, 200) and you pass in i_new_x and i_new_y values of 50 and 50, the new location of the image object will be (50, 50).

Placing Multiple Objects

If you want to place more than one image object at once, then you can use the last two parameters of the function. First you must compile a list (an STL vector) of objects that you want to either exclude or include. If you want to place all image objects except certain ones, pass those in for ex_list along with the flag LIST_IN. If you want to place only a certain set of objects, pass those in for ex_list along with the flag LIST_OUT. You should also pass ALL_IMAGES for str_image_id.

 

Use

CImageMngr image;
// place one image object
image.PlaceImage(50, 50, "my_image");
// place ALL image objects except "my_image"
exclude ex_list;
ex_list.push_back("my_image");
image.PlaceImage(50, 50, ALL_IMAGES, ex_list, LIST_IN);
// place ONLY these three image objects
exclude ex_list;
ex_list.push_back("my_image1");
ex_list.push_back("my_image2");
ex_list.push_back("my_image3");
image.PlaceImage(50, 50, ALL_IMAGES, ex_list, LIST_OUT);
 

Prev: MoveImage
Next: RemoveAll