Zoom in out issue

When I import an image as the background and zoom out the graph, the background image doesn’t stretch to fit the graph area.

GoDiagram does not support .NET the Control.BackgroundImageLayout property.

You should add the image to the GoView.BackgroundLayer and then manage events to size it:

    GoImage bg = new GoImage();
    bg.Name = "world.jpg";        
    // comment out next 2 lines if you want real size of image. (and goview1_resize event handler)
    bg.Bounds = goView1.DocExtent;
    RectangleF rf = goView1.DocExtent;
    //bg.Bounds = new RectangleF(rf.X, rf.Y, 2048, 2048);   // or make it really big
    goView1.BackgroundLayer.Add(bg);

then handle the DocScale PropertyChanged event on the GoView:

private void goView1_PropertyChanged(object sender, PropertyChangedEventArgs e) {
  if (e.PropertyName == "DocScale") {
    foreach (GoObject o in goView1.BackgroundLayer) {
      GoImage im = o as GoImage;
      if (im != null) im.Bounds = goView1.DocExtent;
    }       
  }
}

and the Resize event if you want to:

private void goView1_Resize(object sender, EventArgs e)
{
  foreach (GoObject o in goView1.BackgroundLayer) {
    GoImage im = o as GoImage;
    if (im != null) im.Bounds = goView1.DocExtent;
  }
}

Thanks very much. It’s works fine