/** generate some small images and render them on the backgroun. */ static void GenSmallImage( int img_count, Gdiplus::Graphics *g, const Gdiplus::RectF &render_rect, int sel ) { #define RAND_ALPHA ( 100 + random( 55 ) ) if( img_count < 1 ) { return; } CFileListManager &file_manager = GetInst( CFileListManager ); // render without alpha value Gdiplus::Image *img = CreateImgFromBuffer( file_manager.GetRandSmall() ); Gdiplus::PointF render_pos = GetRandPosInULRect( img->GetWidth(), img->GetHeight(), render_rect ); Gdiplus::RectF img_rect( render_pos.X, render_pos.Y, (float)img->GetWidth(), (float)img->GetHeight() ); img_alpha( g, img, render_pos.X, render_pos.Y, img_count == 1 ? 255 : RAND_ALPHA ); delete img; // render with random alpha value and random rotation degree g->SetClip( img_rect ); for( int i = 1; i < img_count; ++ i ) { img = CreateImgFromBuffer( file_manager.GetRandSmall() ); img_rotate( g, img, render_pos.X, render_pos.Y, img->GetWidth() / 2, img->GetHeight() / 2, random( 360 ), // [0-360) RAND_ALPHA ); // [100-155) delete img; } g->ResetClip(); // blend a 'X' sign onto the picture if it's not the answer if( img_count > 1 ) { //BlendXSign( g, img_rect ); } // blend 'A''B''C''D' sign. BlendSelSign( g, img_rect, sel ); }
void img_rotate_right(img_t *img) { img_rotate(img, 1); }
void img_rotate_left(img_t *img) { img_rotate(img, 3); }