Latest developer linksBookmark and Share
 
HomeThis WeekTop MonthTop AlltimeSearchRegisterFAQ
  
 
Submit Your Link
Please login to submit your Link
 

Transform Matrix Problem

Posted: Feb/15/2010   By: pankaj   Points:15   Category: .NET  - .NET Framework    Views:149   Vote Up (0)   Vote Down (0)    
Hi, Assume drawing a house on the lower left corner of one form:
protected override void OnPaint(PaintEventArgs e)
{
float zoom = 1F;

e.Graphics.Transform = new System.Drawing.Drawing2D.Matrix(
new System.Drawing.RectangleF(0, 0, Width, Height),
new System.Drawing.PointF[]{
new System.Drawing.PointF(0,Height/zoom),
new System.Drawing.PointF(Width/zoom,Height/zoom),
new System.Drawing.PointF(0,0)});

Pen p = new Pen(Color.Black, 1);
e.Graphics.DrawLine(p, 0, 0, 100, 0);
e.Graphics.DrawLine(p, 100, 0, 100, 100);
e.Graphics.DrawLine(p, 100, 100, 0, 100);
e.Graphics.DrawLine(p, 0, 100, 0, 0);
e.Graphics.DrawLine(p, 0, 100, 50, 150);
e.Graphics.DrawLine(p, 50, 150, 100, 100);
}


My problem is that with this transformation some parts of that house will disappear. And if I set zoom to something other than 1, the house will move on the form. Can anybody please say where is my fault?

View Complete Post


Comments:
Be the first to comment this post.
 
Post Comment
Please login to post your comment
More Related Resources

Concurrent Affairs: Solving The Dining Philosophers Problem With Asynchronous Agents

  
We use the new Asynchronous Agents Library in Visual C++ 2010 to solve the classic Dining Philosophers concurrency problem.Rick MolloyMSDN Magazine June 2009

Test Run: Testing Custom Transform Streams

  
Dr. James McCaffreyMSDN Magazine March 2007

Extreme ASP.NET: A New Solution to an Old State Storage Problem

  
State management in Web applications is a contentious issue. Should you store user data per session or should you persist it across sessions? You can easily store information temporarily while someone navigates your site by using session state. Fritz OnionMSDN Magazine April 2006

Scripting SQL: VBScript Interfaces in SQL Server 2000 Let You Transform Data and Provide Reports to

  
Application service providers often must send information to clients automatically rather than on-demand. For example, a manufacturer may want to know each day how many of their products were sold by a retail chain. While SQL Server is ideal for maintaining this type of database, you have to write scripts to get the data out in a client-friendly format. Here you will see how you can use Data Transformation Services (DTS), a powerful tool in SQL Server, to automate the retrieval and formatting of data from SQL Server 2000 and make the process of pushing data to your users a lot easier.Alok Mehta and Daniel WilliamsMSDN Magazine August 2002

DirectX 8.0: Enhancing Real-Time Character Animation with Matrix Palette Skinning and Vertex Shaders

  
DirectX 8.0 allows the creation of smooth and realistic character movements that are more life-like than simple articulated structure animations. This is made possible by its improved support for vertex tweening and blended vertex deformations, also known as soft-skinning. After a brief history of the use of these techniques in DirectX, soft-skinning using the fixed function pipeline is discussed. This is followed by the use of matrix palettes from within vertex shaders to create a customized soft-skinning solution that takes advantage of the benefits of vertex shaders, such as hardware acceleration and custom lighting algorithms without the limitations of fixed-function solutions.Benjamin FreidlinMSDN Magazine June 2001

Graphics: Manipulate Digital Images in Internet Explorer with the DirectX Transform SDK

  
The Microsoft DirectX Transform is a Microsoft DirectX media API that can be used to create animated effects as well as to create and edit digital images for Windows-based applications. Scripting and HTML can be used to display an existing transform on a Web page, and improved transform support in Microsoft Internet Explorer 5.5 makes it easy to use transforms. This article provides step-by-step instructions for writing a transform as an ATL project and shows an example of an image transform. C++ is used to instantiate, configure, and display transforms in this project.Alex LernerMSDN Magazine March 2001

XML Wrapper Template: Transform XML Documents into Visual Basic Classes

  
The XML Wrapper template described in this article transforms XML documents into Visual Basic classes, hiding the more complex parts of using the Microsoft XML parser. Developers who have little knowledge of XML or the Microsoft XML parser can use classes created with the template, thus making it easier to use XML in their projects. This article describes the template, shows classes in a sample application based on the template, and explains how to customize those classes to support repeating child elements. Although this project is illustrated using Visual Basic 6.0, the technique can be extended for use with other versions of Visual Basic and with other languages.Dave Grundgeiger and Patrick EscarcegaMSDN Magazine January 2001

ASP .NET 2.0 website crashing problem

  
Hi,I have an ASP .NET 2.0 web application. I used VB .Net to implement and the DB is in Microsoft SQL Sever 2000. After I published it to the production severs, I encountered a problem. Several times, the site just kind of crashed. No any error pages. Basically, everytime, the site was working fast and good at the beginning. After completing several forms, it suddently takes forever to response to another user's action, like button clicking... It looks like the DB connection is suddenly broken for a while. I checked the Event Log, i didn't see anything wrong. But after a while, it starts to work fine again. Does anyone have any suggestions? thanks

Problem with web.config file

  
Hi, I have a hosting plan with .NET 2.0, 3.0, 3.5
Windows Server 2008 / IIS 7.0. I made a project in asp.net (net 2.0) but when i upload it to my hosting plan I always get this error message:

500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.

I removed web.config file from my directory and start getting the main page of my website but when i click on the button (asp.net button which verifies the password from the database after taking it from a checkbox) i get the following error message.
Server Error in '/' Application.


Runtime Error




Description: An
application error occurred on the server. The current custom error
settings for this application prevent the details of the application
error from being viewed remotely (for security reasons). It could,
however, be viewed by browsers running on the local server machine.

Details: To enable the
details of this specific error message to be viewable on remote
machines, please create a <customErrors> tag within a
"web.config" configuration file located in the root directory of the
current web application. This <customErrors> tag should then have
its "mode" attribute set to "Off".







<!-- Web.Config Configuration File --><configuration> <system.web> <customErrors mode="Off"/> </system.web></configuration>






Notes:
The current error page you are seeing can be replaced by a custom error
page by modifying the "defaultRedirect" attribute of the application's
<customErrors> configuration tag to point to a custom error page
URL.







<!-- Web.Config Configuration File --><configuration> <system.web> <cus

Publish Problem

  
hi everyone,this is my first time in www.asp.net , hope you and i will have great time.My problem is:I'm publishing a web site with'a 3 layered design pattern. a web site , a database model and a layer used for database queries.when I publish the web site, i can't see differences i made in query layer(A Class Library project).I can see those differences when I run and debug the code but same thing is not working when i publishCould anyone tell me how can i see the differences i made in class library project(I have read lots of post and articles but i couldn't solve it)
 
Categories:
.NET
Java
PHP
C/C++/VC++
HTML/XML
SAP
MainFrames
Data Warehousing
Testing
MySQL
SQL Server
Oracle
Javascript/VB Script
Others
Login
 
 
 
 
 Forgot password
 Contact Us   Terms Of use   Share your knowledge