ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  makeImage and setBackground2
Posted by Rene Petry on Apr-23-2007 17:57
Hello!

We want to create a chart with background file insert in the chart when saved as a image (makeImage). How we can do this? setBackground2 set only the reference to the file and dont insert the second image-file into the new by creating the file.

We need this functionality because we call the image from a second application word.

Thanks for any help!

Rene

  Re: makeImage and setBackground2
Posted by Peter Kwan on Apr-23-2007 21:54
Hi Rene,

ChartDirector does include the background image into the chart when you call makeImage.

If you think the background image is not included, it is likely to because the background image file does not exist. For example, an incorrect path name may be used.

To avoid confusion, and for testing purposes, please use "absolute path name", like "c:\path\to\myimage.png". Also, if you are using C# or C++, please ensure the "\", when entered as literal string in code, should be entered as "\\".

We suggested to use absolute path name for testing, because from our experience, in many case, the "current working directory" of the application may be not where the developer expect. If using "absolute path name" works, but using relative path name does not work, then we can confirm that the relative path name is incorrect (it assumes the incorrect "current working directory").

If the above still does not solve the problem, would you mind to inform me of the code you are using?

Regards
Peter Kwan

  Re: makeImage and setBackground2
Posted by Rene Petry on Apr-24-2007 16:06
Hi Peter,
sorry for my mistake in question. Now with your answer i find that the main point is we insert the chart into a bitmap and than we create with the Save method a png file. In screen we can see the image but not in the File on hard disk?
Thanks for help.
Rene

  Re: makeImage and setBackground2
Posted by Peter Kwan on Apr-25-2007 02:59
Hi Rene,

I am somewhat confused on what your code has done exactly and in what order. For example, I am not sure what you mean by "insert the chart into a bitmap". Also, it is not clear what you mean by "than we create with the Save method a png file" (the Save method of which object, and how you get that object)? It is possible to inform me of your charting code?

Also, it is not apparent to me if your application is a Web Forms or Windows Forms application. If it is a Windows Forms application, I will probably do (assume C#):

viewer.Image = c.makeImage();
viewer.Image.Save("c:\\test.png", ImageFormat.Png);

Regards
Peter Kwan