Esempio n. 1
0
static void draw_title_bar_image ( RoadMapImage header_image, RoadMapGuiRect *rect, const RoadMapGuiPoint* pos )
{

   int width = roadmap_canvas_width ();
   int num_images;
   int image_width;
   RoadMapGuiPoint point, bottom_right_point;
   int i;


#ifdef OPENGL
   bottom_right_point.x = rect->maxx+1;
   bottom_right_point.y = rect->maxy;
   roadmap_canvas_draw_image_scaled( header_image, pos, &bottom_right_point, 0, IMAGE_NOBLEND );
#else
   image_width = roadmap_canvas_image_width(header_image);

   num_images = width / image_width;

   num_images = (rect->maxx/image_width)+1;

   if (header_image)
   {
      for ( i=0; i<=num_images; i++ )
      {
             point.x = pos->x + i * image_width;
             point.y = pos->y;
             roadmap_canvas_draw_image( header_image, &point, 0, IMAGE_NOBLEND );
       }
    }
#endif
}
Esempio n. 2
0
static void drawBarBGImage( const char* res, const RoadMapGuiPoint* pos ) {

   RoadMapImage image;
   int width = roadmap_canvas_width ();
   int height = roadmap_canvas_height();
   int num_images;
   int image_width, image_height;
   int i;
   RoadMapGuiPoint bottom_right_pos, BarLocation;
   RoadMapImage bgImage = (RoadMapImage) roadmap_res_get( RES_BITMAP, RES_SKIN, res );


   image_width = roadmap_canvas_image_width( bgImage );
   image_height = roadmap_canvas_image_height( bgImage );

   bottom_right_pos.x = roadmap_canvas_width ();
   bottom_right_pos.y = pos->y + image_height;

#ifdef OPENGL
   roadmap_canvas_draw_image_scaled( bgImage, pos, &bottom_right_pos, 0, IMAGE_NORMAL );
#else
   num_images = width / image_width ;
   BarLocation.y = pos->y;
   for ( i = 0; i < num_images; i++ )
   {
		BarLocation.x = pos->x + i * image_width;
		roadmap_canvas_draw_image( bgImage, &BarLocation, 0, IMAGE_NORMAL);
   }
#endif
}