Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How can I draw custom anchor (Read 2232 times)
gamjaradio
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 42
Joined: Jul 16th, 2010
How can I draw custom anchor
Feb 15th, 2011 at 4:31pm
Print Post  
I set the source code , below.

new AnchorPoint(0, 50, true, true, com.mindfusion.diagramming.MarkStyle.Custom) }

at the Custom of MarkStyle , I want to set an image,
How can I do it?

thanks for regard
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How can I draw custom anchor
Reply #1 - Feb 16th, 2011 at 9:39am
Print Post  
For example this draws an image centered at the anchor point position:

Code
Select All
public void drawAnchorPoint(DrawAnchorPointEvent e)
{
	Point2D pt =  diagView.deviceToDoc(image.getWidth(), image.getHeight());
	Point2D imgPos = e.getLocation();
	imgPos.setLocation(imgPos.getX(), imgPos.getY() - pt.getX() / 2);
	e.getGraphics().drawImage(image, (int)imgPos.getX(), (int)imgPos.getY(),
		(int)pt.getX(), (int)pt.getY(), diagView);
} 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint