Background Image comes with white border

I am working on adding an image to a GoTextNode, however the image get added with an extra white border around it. How can I get rid of this border.

Sample code

Dim ImageNode as GoImage = new GoImage

ImageNode.Name = FileName 'with full path

ImageNode.Selectable = False

ImageNode.Movable = False

ImageNode.AutoRescales = True

ImageNode.Center = TextNode.Backgound.Center


We don’t add a border to an image. It must be the GoTextNode background.

It is actually adding a distinct border in my case. The image is actually very small in size and sits well with in the node. I am unable to upload an image else I could share the screen shot with you to show the same. I am using Go Diagram Version 2.6.2 for .NET 1.1 at the moment ( which I accept is little old).

yeah, very old. But still I can’t think why that would happen. If you just add the GoImage directly to the document, does it have a border?

you can upload images by replying with the “post reply” button on the top of the page.


Thanks for info about uploading the image. I am uploading two images here, one with GoImage added to my GoTextNode

and the second one is where I have added the GoImage directly to the Document

My Image is actually very small to I have to zoom it to 400%. In the first image(for the text node) left part of the image show the actual node size and the image while the other half of the image is when it is zoomed at 400%

Ok, I wasn’t getting this before, now I am. The white border shows up WITHIN the image. It seems to be some sort of an interference pattern in the way .NET opens the image.

I tried editing the .png file you emailed me, and saved it as .jpg and .bmp. Both looked fine in the editor, but had this pattern when used in GoDiagram. I used Paint Shop Pro to create my own .png file with the same gradient, and that had the same problem.

Here’s a workaround… don’t use an image file. Use a GoDrawing with a gradient.

GoDrawing square = new GoDrawing(GoFigure.Square);

square.Size = new SizeF(22, 22);

square.FillSimpleGradient(Color.FromArgb(255, 217, 226, 239), Color.FromArgb(255, 181, 167, 201), TopLeft);

square.Pen = null;

Oh, and you should look at the DecoratedTextNode sample to see how to add a decoration to a GoTextNode. (in the NodeLinkDemo sample… or Demo1 given that you’re using an old version of Go)