Jump to content
Software FX Community
Sign in to follow this  
User (Legacy)

Annotation and ChartFX

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

Share this post


Link to post
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

Share this post


Link to post
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

>

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...