User (Legacy) Posted August 22, 2005 Report Share Posted August 22, 2005 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 Quote Link to comment Share on other sites More sharing options...
Software FX Posted August 23, 2005 Report Share Posted August 23, 2005 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 Quote Link to comment Share on other sites More sharing options...
User (Legacy) Posted August 26, 2005 Author Report Share Posted August 26, 2005 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 > Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.