Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How to show blurred image while dragging shape from shapetoolbar to diagramView section (Read 2247 times)
ashar11
Junior Member
**
Offline


I Love MindFusion!

Posts: 56
Joined: Jun 29th, 2017
How to show blurred image while dragging shape from shapetoolbar to diagramView section
Sep 14th, 2017 at 11:26am
Print Post  
Hi,
   I am using custom images in shapetoolbar, i want to show a blurred image for that particular image which i am dragging from shapetoolbar to diagram view section.

Thanks
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3435
Joined: Oct 19th, 2005
Re: How to show blurred image while dragging shape from shapetoolbar to diagramView section
Reply #1 - Sep 14th, 2017 at 1:09pm
Print Post  
Hi,

You can display bitmap by handling DiagramView.DragOver and ShapeToolBar.GiveFeedBack -

Code
Select All
Shape currentShape;

void diagramView_DragOver(object sender, DragEventArgs e)
{
	e.Effect = DragDropEffects.Copy;
	var draggedShape = e.Data.GetData(typeof(DraggedShape)) as DraggedShape;
	if (draggedShape != null)
		currentShape = Shape.FromId(draggedShape.Id);
}

void shapeBar_GiveFeedback(object sender, GiveFeedbackEventArgs e)
{
	if (e.Effect == DragDropEffects.Copy && currentShape != null)
	{
		e.UseDefaultCursors = false;
		var image = currentShape.Image;
		if (image != null)
			Cursor.Current = new Cursor(image.GetHicon());
		return;
	}

	e.UseDefaultCursors = true;
} 



Try this for making the image translucent -
https://stackoverflow.com/questions/33783942/change-alpha-coefficient-using-lock
bits

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
ashar11
Junior Member
**
Offline


I Love MindFusion!

Posts: 56
Joined: Jun 29th, 2017
Re: How to show blurred image while dragging shape from shapetoolbar to diagramView section
Reply #2 - Sep 15th, 2017 at 11:55am
Print Post  
problem fixed, thanks
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint