Example #1
0
static RoadMapImage create_title_bar_image (RoadMapImage header_image, RoadMapGuiRect *rect) {

   RoadMapImage image;
   int width = roadmap_canvas_width ();
   int num_images;
   int image_width;
   RoadMapGuiPoint point;
   int i;

   image = roadmap_canvas_new_image (width,
               roadmap_canvas_image_height(header_image));
   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 = i * image_width;
             point.y = 0;
             roadmap_canvas_copy_image (image, &point, NULL, header_image, CANVAS_COPY_NORMAL);
       }
    }

   return image;
}
Example #2
0
static RoadMapImage createBGImage (RoadMapImage BarBgImage) {

   RoadMapImage image;
   int width = roadmap_canvas_width ();
   int height = roadmap_canvas_height();
   int num_images;
   int image_width;
   int i;

   if (height > width){
      width = width*2;
   }

   image = roadmap_canvas_new_image (width,
               roadmap_canvas_image_height(BarBgImage));

   image_width = roadmap_canvas_image_width(BarBgImage);

   num_images = width / image_width ;

   RoadMapGuiRect *rect = malloc(sizeof(RoadMapGuiRect));
   rect->minx = num_images;
   rect->miny = 0;

//   for (i = 0; i < num_images; i++){
      RoadMapGuiPoint BarLocation;
      BarLocation.y = 0;
      BarLocation.x = 0;//i * image_width;
         roadmap_canvas_copy_image
         (image, &BarLocation, rect, BarBgImage ,CANVAS_COPY_NORMAL);
//   }
   return image;
}
Example #3
0
static RoadMapImage create_sides_image (int style, int header, int pointer_type, RoadMapGuiPoint *bottom, RoadMapGuiPoint *top, int num_items) {
   RoadMapImage image;
   int image_width = abs(bottom->x  - top->x);
   RoadMapGuiPoint point;
   int i;

   image = roadmap_canvas_new_image (image_width, s_images[border_white_left+style].height * num_items);

   for (i = 0; i<num_items; i++){
      point.x = image_width - s_images[border_white_right+style].width ;
      point.y = i* s_images[border_white_right+style].height;
      roadmap_canvas_copy_image (image, &point, NULL, s_images[border_white_right+style].image, CANVAS_COPY_NORMAL);


      point.x = 0;
      point.y = i* s_images[border_white_left+style].height;
      roadmap_canvas_copy_image (image, &point, NULL, s_images[border_white_left+style].image, CANVAS_COPY_NORMAL);
   }


   return image;
}
Example #4
0
static RoadMapImage create_bottom_image (int style, int header, int pointer_type, RoadMapGuiPoint *bottom, RoadMapGuiPoint *top) {

   RoadMapImage image;
   int screen_width, screen_height, image_width;
   RoadMapGuiPoint right_point, left_point;
   RoadMapGuiPoint sign_bottom, sign_top, point;
   int i,num_items;
   image_width = abs(bottom->x  - top->x);


   screen_width = roadmap_canvas_width();
   screen_height = roadmap_canvas_height();

   if (top == NULL)
   {
      sign_top.x = 1;
      sign_top.y = 0;
   }
   else{
      sign_top.x = top->x ;
      sign_top.y = top->y ;
   }

   if (bottom == NULL)
   {
      sign_bottom.x = screen_width-1;
      sign_bottom.y = 0;
   }
   else{
      sign_bottom.x = bottom->x;
      sign_bottom.y = bottom->y;
   }


   image = roadmap_canvas_new_image (image_width, s_images[border_white_top+style].height);

#ifdef TOUCH_SCREEN
      left_point.x = sign_top.x;
#else
      left_point.x = sign_top.x-1;
#endif
      right_point.x = image_width - s_images[border_white_right+style].width;
      left_point.y = 0;

      point.x = 0;
      point.y = 0;
      roadmap_canvas_copy_image (image, &point, NULL, s_images[border_white_bottom_left+style].image, CANVAS_COPY_NORMAL);


       point.x = right_point.x;
       point.y = 0;
       roadmap_canvas_copy_image (image, &point, NULL, s_images[border_white_bottom_right+style].image, CANVAS_COPY_NORMAL);


      num_items = (image_width - s_images[border_white_right+style].width - s_images[border_white_left+style].width)/s_images[border_white_top+style].width;
      for (i = 0; i<num_items; i++){
         point.x = s_images[border_white_top_left+style].width + i * s_images[border_white_bottom+style].width ;
         point.y = 0;
         roadmap_canvas_copy_image (image, &point, NULL, s_images[border_white_bottom+style].image, CANVAS_COPY_NORMAL);
      }

   return image;
}