コード例 #1
0
ファイル: vikgeoreflayer.c プロジェクト: guyou/viking
static void check_br_is_good_or_msg_user ( VikGeorefLayer *vgl )
{
  // if a 'blank' ll value that's alright
  if ( vgl->ll_br.lat == 0.0 && vgl->ll_br.lon == 0.0 )
    return;

  struct LatLon ll_tl = get_ll_tl (vgl);
  if ( ll_tl.lat < vgl->ll_br.lat || ll_tl.lon > vgl->ll_br.lon )
    a_dialog_warning_msg ( VIK_GTK_WINDOW_FROM_LAYER(vgl), _("Lower right corner values may not be consistent with upper right values") );
}
コード例 #2
0
ファイル: vikgeoreflayer.c プロジェクト: rpeyron/viking
static void georef_layer_load_image ( VikGeorefLayer *vgl, VikViewport *vp, gboolean from_file )
{
  GError *gx = NULL;
  if ( vgl->image == NULL )
    return;

  if ( vgl->pixbuf )
    g_object_unref ( G_OBJECT(vgl->pixbuf) );
  if ( vgl->scaled )
  {
    g_object_unref ( G_OBJECT(vgl->scaled) );
    vgl->scaled = NULL;
  }

  vgl->pixbuf = gdk_pixbuf_new_from_file ( vgl->image, &gx );

  if (gx)
  {
    if ( !from_file )
      a_dialog_error_msg_extra ( VIK_GTK_WINDOW_FROM_WIDGET(vp), _("Couldn't open image file: %s"), gx->message );
    g_error_free ( gx );
  }
  else
  {
    vgl->width = gdk_pixbuf_get_width ( vgl->pixbuf );
    vgl->height = gdk_pixbuf_get_height ( vgl->pixbuf );
  }

  if ( !from_file )
  {
    if ( vik_viewport_get_drawmode(vp) != VIK_VIEWPORT_DRAWMODE_UTM )
    {
      a_dialog_warning_msg ( VIK_GTK_WINDOW_FROM_WIDGET(vp),
                             _("GeoRef map cannot be displayed in the current drawmode.\nSelect \"UTM Mode\" from View menu to view it.") );
    }
  }
  /* should find length and width here too */
}