Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Custom Drawing of node without node size zoom (Read 1294 times)
jf2020
Junior Member
**
Offline


I love FlowChart!

Posts: 63
Joined: Feb 23rd, 2006
Custom Drawing of node without node size zoom
Mar 1st, 2013 at 7:08am
Print Post  
Hi,

I need to draw a node using an image (a 16x16 pixel icon) that should have the same size irrespective of the zoom level.  So I think that I have to modify the transform matrix that I get in the DrawNodeEventArgs to not scale the image when I call DrawImage. I have tried that but not been fully succesful (I have just reset the transform). What is the best way to do that?

JF
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Custom Drawing of node without node size zoom
Reply #1 - Mar 1st, 2013 at 8:48am
Print Post  
Hi,

Try this:

Code
Select All
private void diagram_DrawNode(object sender, DrawNodeEventArgs e)
{
	var imgRectPix = Utilities.DocToDevice(e.Graphics, e.Bounds);
	imgRectPix.Width = imgRectPix.Height = 16;
	var imgRectDiag = Utilities.DeviceToDoc(e.Graphics, imgRectPix);
	e.Graphics.DrawImage(image, imgRectDiag);
} 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
jf2020
Junior Member
**
Offline


I love FlowChart!

Posts: 63
Joined: Feb 23rd, 2006
Re: Custom Drawing of node without node size zoom
Reply #2 - Mar 1st, 2013 at 8:56am
Print Post  
Thanks Stoyan!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint