Jump to content
Software FX Community

Annotation and ChartFX


User (Legacy)

Recommended Posts

Hi,

I'm using Delphi 2005 with ChartFX and the Annotation extension to add a

couple of JPG images to a chart. However, I want to be able to load the

images from a database, a resource or a control rather than the actual

picture file itself. I have been unable to find a way of doing this - there

only seems to be the option to LoadFromFile.

Is there a way I can create a Picture object without referencing a filename?

Thanks in advance!

Sandra

Link to comment
Share on other sites

Assuming you are using .NET and Chart FX 6.x:

The annotation picture class has a Picture property of type

System.Drawing.Image, this allows you to assign an image object that you

have previously loaded (from your DD, file, etc.)

If you are using the COM version (Chart FX 5.x):

Similar except that the Picture property is of type TPicture instead.

--

Francisco Padron

www.chartfx.com

Link to comment
Share on other sites

Hi Francisco,

Have tried using Picture but can't seem to get it to display. I'm loading

it from a stream ( have checked it by loading it into a Timage as well and

it does that fine). Here's my code - would you mind having a look and

seeing if I've missed something?

var

annotPic : AnnPicture;

AnnotX: AnnotationX;

aPic : TBitmap;

AnnotX := AnnotationX.Create;

ChartFXCS1.AddExtension(AnnotX.InterfacePtr);

AnnotX.ToolBarObj.Visible := false;

annotPic := AnnPicture.Create(AnnotX.Add(OBJECT_TYPE_PICTURE,0));

aPic := Tbitmap.Create;

if LoadAPicResource(PicStream,'BMP') then // this

returns a resource stream via PicStream - this part works!

begin

aPic.LoadFromStream(PicStream);

annotPic.Picture.Assign(aPic);

end;

Have also tried loading directly using :-

annotPic.Picture.Bitmap.LoadFromStream(PicStream);

and also tried using TPicture instead of TBitmap.

Nothing seems to work, and I'm left with a blank dotted outline on the chart

where the picture should be.

Any thoughts?

Sandra

"SoftwareFX Support" <noreply@softwarefx.com> wrote in message

news:$jz4InBqFHA.1724@webserver3.softwarefx.com...

> Assuming you are using .NET and Chart FX 6.x:

>

> The annotation picture class has a Picture property of type

> System.Drawing.Image, this allows you to assign an image object that you

> have previously loaded (from your DD, file, etc.)

>

> If you are using the COM version (Chart FX 5.x):

>

> Similar except that the Picture property is of type TPicture instead.

>

> --

> Francisco Padron

> www.chartfx.com

>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...