Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic icon quality...? (Read 1848 times)
mberger
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 44
Joined: Jan 6th, 2009
icon quality...?
Mar 14th, 2009 at 9:40am
Print Post  
Hi,

after i added a custom IconNode to my diagram everthing is allright. But if i move this icon, the quality of the icon (image) decreases.

... is there any possibility to avoid this?

Best regards Marco



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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: icon quality...?
Reply #1 - Mar 14th, 2009 at 9:56am
Print Post  
Try to align the coordinates where the image is drawn to the boundaries of device pixels. You can do that by calling ClientToDoc(DocToClient(diagramPoint)), and then use the result as the top-left coordinates for DrawImage.
  
Back to top
 
IP Logged
 
mberger
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 44
Joined: Jan 6th, 2009
Re: icon quality...?
Reply #2 - Mar 14th, 2009 at 10:30am
Print Post  
... sorry but im realy new in coding vb.net.

I'm adding my shapes like the sample "IconNodes".So i'm not shure where i have to add the doctoclient function.

And where can i get the system.drawing.pointF "diagrampoint"?

Best regards Marco
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: icon quality...?
Reply #3 - Mar 15th, 2009 at 11:41am
Print Post  
In IconNode.vb find the Draw implementation and replace the DrawImage call with the following:

Code
Select All
' Draw the icon center at the top
Dim dv As DiagramView = options.TargetView
Dim pf As New PointF(Bounds.X + Bounds.Width / 2 - imageSize.Width / 2, Bounds.Y)
pf = dv.ClientToDoc(dv.DocToClient(pf))
graphics.DrawImage(imgIcon, pf)
 



options.TargetView will be Nothing when exporting an image or a PDF file, so you must check for this if you plan to use the export features.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
mberger
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 44
Joined: Jan 6th, 2009
Re: icon quality...?
Reply #4 - Mar 16th, 2009 at 5:25am
Print Post  
Hi Stoyan,

thanks!!!

... thats works fine for me!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint