Draw icons insted of points in a Series
Draw icons insted of points in a Series
I need a TSeries where I can define a bitmap or icon for each point, custom drawing would be acceptable. Wich series would be the best to use and how do I insert my bitmaps?
Thanks, was it that easy... Just two small issues left. I have my pictures in a TImageList and in the GetImage event I want to pick a picture from it.
Procedure TMainForm.SeriesGetImage(Sender: TCustomImagePointSeries; ValueIndex: Integer; Picture: TPicture);
Begin
Picture := ImageList.GetPicture(0) ???
End;
The other question is how I controll the with and height of the picture in the different points?
Please help.
Regards, Mikael
Procedure TMainForm.SeriesGetImage(Sender: TCustomImagePointSeries; ValueIndex: Integer; Picture: TPicture);
Begin
Picture := ImageList.GetPicture(0) ???
End;
The other question is how I controll the with and height of the picture in the different points?
Please help.
Regards, Mikael
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Mikael,
You can do something like this:Thanks, was it that easy... Just two small issues left. I have my pictures in a TImageList and in the GetImage event I want to pick a picture from it.
Code: Select all
procedure TForm1.Series1GetImage(Sender: TCustomImagePointSeries;
ValueIndex: Integer; Picture: TPicture);
var tmpBmp : TBitmap;
begin
tmpBmp:=TBitmap.Create;
ImageList1.GetBitmap(ValueIndex, tmpBmp);
Picture.Bitmap:=tmpBmp;
Series1.Pointer.VertSize:=(ValueIndex+1)*10;
Series1.Pointer.HorizSize:=(ValueIndex+1)*10;
end;
You can use Pointer's VertSize and HorizSize as shown in the code above.The other question is how I controll the with and height of the picture in the different points?
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Perfect! Works like a dream.
But I just got another issue. I use both the TDragMarksTool and the TDragPointTool. It seems like I can never reach the mark, it always finds the point to be dragged, even as the pojnt and the mark are located at some distance.
I tried the SeriesMouseEnter event to se when the "point" was hit and it seems like it "hits" when the mouse is "far" away from the bitmap image! More than 50 pixels away!
How can I limit this "active" area to just the bitmap?
regards, Mikael
But I just got another issue. I use both the TDragMarksTool and the TDragPointTool. It seems like I can never reach the mark, it always finds the point to be dragged, even as the pojnt and the mark are located at some distance.
I tried the SeriesMouseEnter event to se when the "point" was hit and it seems like it "hits" when the mouse is "far" away from the bitmap image! More than 50 pixels away!
How can I limit this "active" area to just the bitmap?
regards, Mikael
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Mikael,
Could you please send us a simple example project we can run "as-is" to reproduce the problem here? You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance!
Could you please send us a simple example project we can run "as-is" to reproduce the problem here? You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance!
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Hello, I sent an updated version where you can se the problem better. After program start there is no way to drag the marks away from the point. If you click the button the marks are moved a bit away. After this the marks can be dragged. If you than drag the mark and position it over the point it will be unaccessable again. You can also enable the popup in MapSeriesMouseEnter and the you can se that the event is triggered without the mouse beeing on the image area.
Hi Mikael,
I think that the best way to accomplish it would be by adding the following code to your app (checking when the marks are clicked) :
I think that the best way to accomplish it would be by adding the following code to your app (checking when the marks are clicked) :
Code: Select all
procedure TForm1.MapChartMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
MapChartDragPointTool.Active := not (MapSeries.Marks.Clicked(x,y)<>-1);
end;
procedure TForm1.MapChartDragPointToolDragPoint(Sender: TDragPointTool;
Index: Integer);
begin
MapSeries.Marks.ResetPositions;
end;
Pep Jorge
http://support.steema.com
http://support.steema.com
Ok, this was a while ago but now I'm back!
The solution you suggested will work for drag but I also have events for MouseEnter and MouseLeave! I show values in a status window when I move the mouse above the icons! Currently these events trigger already when the mouse is located some distance from the icon (like 50 pixels away)!
The solution you suggested will work for drag but I also have events for MouseEnter and MouseLeave! I show values in a status window when I move the mouse above the icons! Currently these events trigger already when the mouse is located some distance from the icon (like 50 pixels away)!
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Lenfors,
I'm not able to reproduce the problem here. Could you please send us a simple example project we can run "as-is" to reproduce the problem here?
Thanks in advance.
I'm not able to reproduce the problem here. Could you please send us a simple example project we can run "as-is" to reproduce the problem here?
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |