.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

LayoutTransform not taking mouse location as center for ZoomIn or ZoomOut !!?

Posted By:      Posted Date: October 27, 2010    Points: 0   Category :WPF

Hello everyone,

I am using LayoutTransform for zooming in and out of my canvas and is working exactly the way I want (almost).

I have a small problem though. Its not taking mouse location as center for ZoomIn or ZoomOut. It always takes top left corner (0,0) for this operation.

Here is my code:

private void ZoomIn()
            //Get the current matrix
            Matrix currentMattrix = this.canvas.LayoutTransform.Value;

            double mouseX = Mouse.GetPosition(this.canvas).X;
            double mouseY = Mouse.GetPosition(this.canvas).Y;

             //Zoom in by increasing the scale transofrm
             this.canvas.LayoutTransform = new ScaleTransform(currentMattrix.M11 + 0.1, currentMattrix.M22 + 0.1, mouseX, mouseY);

Any ideas?

View Complete Post

More Related Resource Links

Seadragon mouse wheel motion zoom/zoomout not working

using following code.. vs 2008 andajaxtoolkit 3.5.40412.2what is is to be done to make it work? <form id="form1" runat="server"> <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"> </ajaxToolkit:ToolkitScriptManager> <ajaxToolkit:Seadragon ID="Seadragon2" Height="500px" Width="500px" runat="server" SourceUrl="dzc_output.xml" MouseNavEnabled="true" > </ajaxToolkit:Seadragon> </form>

How to highlight datagrid or GridView row on mouse over?

This article will show how you can Ajax with GridView to display popup messages when mouse moves over certain column. In the demo project I have added first column as an image column with a help icon in it. This kind of implements a feature that if you want more information about the row you can move mouse over this icon, a asynchronous request is sent to server for data about that row and when call returns the returned message is show as a popup message.

center alignment of web page


Hiiii Coders,

I have build a website . Now what i want is that it should be centralized according to resolution i.e.. on increasing resolution its margin from both sides should be equal.

Remember I have completely done with my website.

How can i get it done

plz provide some code snippet

thanx and regards 

Wicked Code: Taking Silverlight Deep Zoom To The Next Level


With the help of Silverlight Deep Zoom and a remarkable control named MultiScaleImage, you can create scenes with many levels of zoom. Jeff Prosise illustrates with what else but the Mandlebrot set.

Jeff Prosise

MSDN Magazine July 2009

Windows Mobile: Use GPS And Web Maps For Location-Aware Apps


We show you how to build a location-aware task list application for Windows Mobile devices that uses GPS to remind you of a task when and where it's appropriate.

Christopher Mitchell

MSDN Magazine January 2009

Netting C++: EEK!-Time to Design the Mouse


This month begins the design of the actual mouse class for EEK!

Stanley B. Lippman

MSDN Magazine December 2007

Extreme ASP.NET: Tools of the Trade: Application Center Test


When you sit down to write an ASP. NET application, how much time do you spend thinking about performance? It's unfortunate, but for most developers performance is an afterthought. Performance planning and design really need to be front and center.

Rob Howard

MSDN Magazine June 2005

Resource File: .NET Architecture Center and .NET Designers


Microsoft has recently launched the . NET Architecture Center, a site devoted to business, software, and infrastructure architects who want to understand the Microsoft approach to enterprise software.

MSDN Magazine November 2002

Server Farms: Application Center 2000 Offers World-Class Scalability


Application Center 2000 simplifies the deployment of a Microsoft .NET-based application to clusters, which are shared-nothing, loosely coupled computers that appear as one virtual computer. This allows all the computers in Application Center 2000 clusters to provide the same service or Web application at the same time. This article explains network load balancing and component load balancing for COM+ components with Application Center 2000. Accessing the features of Application Center 2000 though the MMC snap-in interface and the command-line interface for batching administrative tasks is also covered.

Panos Kougiouris

MSDN Magazine May 2001

Highlight gridview row on mouse hover in asp.net

The article Highlight gridview row on mouse hover in asp.net was added by uniquesaiful on Sunday, June 06, 2010.

Gridview control is a customizable and flexible control used to display data in tabular format. It has some nice features. But lacks of some client side features that makes web users happy. We can easily add these features with few lines of code. For

Buttons with Mouse-Over Behaviors - Redux

I recently posted some CSS and HTML snippets for a buttons collection I was using for a Menu style UI Scott Koon from www.LazyCoder.com posted a comment with a better way (thanks Scott). This way I don't have to set the CSS Class for each button. Just contain them in a div. Here is the [...] Read More......(read more)

Gridview, guid ID, and Location


Presently I have a gridview, I'm in the process of populating the gridview. One colunm "Location" is displayed as the guid ID.  I need for that colunm to be displayed as the location. Here some of the code to display the grid.

myObject orgs = new myObject();
grid.DataSource = orgs;


orgs gets a list of organizations (locations) for the grid. How can I replace the guid ID with it location. Yes the guid ID and location are in a table.

How to stop unauthorized users from sending documents to a Records Center site?


I can't find a way to stop unauthorized users from sending documents to a Records Center site. Can someone please help me? Do i need to configure anything to restrict it to the members of the web submitters group?

I'm still using MOSS2007


The impossibility of doing things depends on your will to do it.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend