Change a control matrix in firemonkey

Hi every

I have a TRectangle and a TMatrix3x2F i managed to copy the Matrix values from the rectangle.AbsoluteMatrix to TMatrix3x2F like this:

{code}
void TForm1::GrabRectMatrix()
{
Matrix3x2F FTransform;

FTransform._11 = Rect1->AbsoluteMatrix.m11;
FTransform._12 = Rect1->AbsoluteMatrix.m12;

FTransform._21 = Rect1->AbsoluteMatrix.m21;
FTransform._22 = Rect1->AbsoluteMatrix.m22;

FTransform._31 = Rect1->AbsoluteMatrix.m31;
FTransform._32 = Rect1->AbsoluteMatrix.m32;
}
//---------------------------------------------------------------------------
{code}

then i managed to make some transformation on this matrix with this code:

{code}
FTransform = FTransform * //Matrix3x2F::Translation(-10,-10) *
			 Matrix3x2F::Rotation(45,D2D1::Point2F(300,275)) *
			 Matrix3x2F::Translation(10,10);
{code}

what i acctually wanna do is to translate the rect and rotate it at the same time with the mouse. but now all i wanted to do is to past these values back to the Rectangle.Matrix for example something like this:

{code}
void ApplyMatrix()
{
Rect1->AbsoluteMatrix.m11 = FTransform._11;
Rect1->AbsoluteMatrix.m12 = FTransform._12;

Rect1->AbsoluteMatrix.m21 = FTransform._21;
Rect1->AbsoluteMatrix.m22 = FTransform._22;

Rect1->AbsoluteMatrix.m31 = FTransform._31;
Rect1->AbsoluteMatrix.m32 = FTransform._32;

Rect1->RecalcEnabled();
Rect1->RecalcAbsolute();
Rect1->RecalcUpdateRect();
Rect1->Repaint();
}
//---------------------------------------------------------------------------
{code}

when i try this function nothing happens at all so what to do.

--
There are 10 kinds of people one who understands binary and one who doesn't.
0
Ahmed
12/30/2011 4:20:29 AM
embarcadero.delphi.firemonkey 4901 articles. 4 followers. Follow

2 Replies
1365 Views

Similar Articles

[PageSpeed] 13

Hi

I've encountered same problem in 3D...

Doesn't work with AbsoluteMatrix...  But working with LocalMatrix and RecalcAbsolute...

{code}
Rect1->LocalMatrix.M = Matrix3DMultiply(CreateRotationMatrix3D(RotVector, Angle), Rect1->LocalMatrix).M;
Rect1->RecalcAbsolute();
{code}

(Use LocalMatrix.M instead of .LocalMatrix.m11,LocalMatrix.m12,....)

I think it is the same problem in 2D Firemonkey...

best regards...

b.tran

Edited by: bernard tran on Feb 21, 2012 3:31 PM

Edited by: bernard tran on Feb 21, 2012 3:34 PM

Edited by: bernard tran on Feb 21, 2012 3:39 PM
0
bernard
2/21/2012 11:39:31 PM
thanks for reply

but do you mean that instead of AbsoluteMatrix i should use Local like this:


{code}
void TForm1::GrabRectMatrix()
{
Matrix3x2F FTransform;
 
FTransform._11 = Rect1->LocalMatrix.m11;
FTransform._12 = Rect1->LocalMatrix.m12;
 
FTransform._21 = Rect1->LocalMatrix.m21;
FTransform._22 = Rect1->LocalMatrix.m22;
 
FTransform._31 = Rect1->LocalMatrix.m31;
FTransform._32 = Rect1->LocalMatrix.m32;
}
//---------------------------------------------------------------------------

FTransform = FTransform * //Matrix3x2F::Translation(-10,-10) *
			 Matrix3x2F::Rotation(45,D2D1::Point2F(300,275)) *
			 Matrix3x2F::Translation(10,10);


void ApplyMatrix()
{
Rect1->LocalMatrix.m11 = FTransform._11;
Rect1->LocalMatrix.m12 = FTransform._12;
 
Rect1->LocalMatrix.m21 = FTransform._21;
Rect1->LocalMatrix.m22 = FTransform._22;
 
Rect1->LocalMatrix.m31 = FTransform._31;
Rect1->LocalMatrix.m32 = FTransform._32;
 
Rect1->RecalcAbsolute();
}
//---------------------------------------------------------------------------
{code}

or do i have to use just Rect1->LocalMatrix.M because Firemonkey 2D apps does not have LocalMatrix but have LocalRect.

--
There are 10 kinds of people one who understands binary and one who doesn't.
0
Ahmed
2/23/2012 4:34:07 AM
Reply:

Similar Artilces:

Ann: FastReport FMX for Delphi XE3 (FireMonkey 2) and XE2 (FireMonkey) released
Dear friends, Visual report designer is available now on both MS Windows and MAC OS X! Full sources. We can write here full list of possibilities, but it will so long. Let see FastReport VCL and FastReport FMX comparison table: http://www.fast-report.com/en/products/comparison-fast-report-firemonkey-vcl.html And all of this - just now in your hands for business-applications for Mac. Report generator FastReport FMX is the first multiplatform solution for including Business Intelligence into software based on Embarcadero FireMonkey IDE (Delphi for MS Windows and Apple Mac OS X)...

Ann: X-platform report generator for Delphi XE3 (FireMonkey 2) and XE2 (FireMonkey) released
Dear friends, Visual report designer is available now on both MS Windows and MAC OS X! Full sources. We can write here full list of possibilities, but it will so long. Let see FastReport VCL and FastReport FMX comparison table: http://www.fast-report.com/en/products/comparison-fast-report-firemonkey-vcl.html And all of this - just now in your hands for business-applications for Mac. Report generator FastReport FMX is the first multiplatform solution for including Business Intelligence into software based on Embarcadero FireMonkey IDE (Delphi for MS Windows and Apple Mac OS X)...

Firemonkey
I am so dammed frustrated with firemonkey and livebindings. The VCL + DB Controls were fast, consistent, and stable. This fmx framework is crap. It's slow on my i5 Macbook. I'd be embarrassed to put out an app like this. The help is lousy and apparently very few people are using it based on my failed Google searches. I can see why. Livebindings is cute when you have a few fields, but it a rats nest when you have a moderately complex form and have to wire up dozens of controls. There is no official support for nullable fields in livebindings which blows my mind....

Virtual Controls in FireMonkey
What are the fireMonkey controls that support UI virtualisation > {quote:title=vikosh maha wrote:}{quote} > What are the fireMonkey controls that support UI virtualisation As of XE2 the TGrid is the only one I know of (certainly TListBox and TTreeView don't). I haven't investigated XE3 far enough yet to give an answer. ...

Installing components for FireMonkey HD and FireMonkey iOS
Hi, How do I install components for both FireMonkey HD and FireMonkey iOS? I have one package 'FMXMyFireMonkeyControl' and 'FMIFireMonkeyControl' which both point to the same file with the same registration 'TFireMonkeyControl'. If I compile one package (FMXMyFireMonkeyControl) it installs correctly, then change the include file (FMCompile.INC) to compile for IOS (FMIFireMonkeyControl) which is included in the FMX.FireMonkeyControl.pas file: {$I FMCOMPILE.INC} uses {$IFDEF COMPILEIOS} FMX_Types, FMX_Objects, FMX_Forms, FMX_Dialogs, FMX_Effe...

Delphi XE2, OSX and FireMonkey?
1. Does anyone know if developing with FireMonkey will be the only way to develop for OSX with XE2? 2. Does anyone know if you will need to compile on a Mac for OSX, or will XE2 cross compile? I know this will all come out during the world tour, but I'm just trying to get some idea so I can start planning. 1. Yes, I think for now it will be the only way. But you can probably build a native UI for OSX by directly using the API, like you can also develop Win32 applications without using the VCL. 2. XE2 will only be available for Windows, but it will compile for other platforms. &l...

Convert XAML to Firemonkey controls?
Anybody spent time or thoughts on converting XAML objects to firemonkey controls? ...

Drag Firemonkey controls at runtime
I would like to be able to drag controls around at runtime. e.g., a rectangle or panel using teh mouse - move it from one location to another With VCL I would use something like this http://delphi.about.com/library/weekly/aa102505a.htm if (Sender is TWinControl) then begin inReposition:=True; SetCapture(TWinControl(Sender).Handle); GetCursorPos(oldPos); end; However, I am completely stuck on how to do similar in firemonkey - I know it is a long shot being so new and all but anyone out there point me the right direction? OK, I have a kind of a work-around u...

Native OS Controls for Firemonkey
I've just launched a Kickstarter project to build a Native OS control framework and component set for Firemonkey. NakeyMonkey is first a set of base components and interfaces that simplify wrapping native OS controls in a cross-platform way allowing them to be write-once, cross-compile. By providing a base component to descend native wrappers from and a base platform object for implementing the OS specific implementation, NakeyMonkey allows components like a RichEdit to be available to your Firemonkey apps without having to rewrite the entire implementation of parsing rich text tags a...

FireMonkey controls and the Hint property
Where are the HINT (and related ShowHint) properties in FM Controls? I am not able to find them. Or is there some other way how to show hint when mouse is over the control? TIA > {quote:title=Miroslav Ondrisek wrote:}{quote} > Where are the HINT (and related ShowHint) properties in FM Controls? I am not able to find them. Or is there some other way how to show hint when mouse is over the control? > > TIA Nobody knows? ...

Making Firemonkey more compatible with Delphi
I have programmed in Delphi since 1995 Delphi1 I am now evaluating Delphi XE4. It boggles my mind, why embarcadero has lost the most important aspects of Delphi. Simplicity and Fast User Interface creation. I can easily see how Firemonkey can be improved to bring it in line with traditional Delphi Techniques by doing the following. 1. All Firemonkey controls need a data aware counterpart. 2. Firemonkey Styles need to be converted to TControl descendants. 3. ie. TLayout goes to TPanel ( TFMXPanel ) 4. ie. TRectangle does to TFrame TFMXFrame ) 5. LiveBindings gets placed un...

Serial Port Controlling in Firemonkey?
Hi, What kind of path should I follow to make my application requires serial port communication compatiable with windows and Mac OS enviorement? Thanks. ...

Delphi XE5 Firemonkey iOS7 Style (where is it?)
It says here http://www.embarcadero.com/products/rad-studio/whats-new that XE5 has "iOS 7 SDK support and style" Where is the iOS7 style? - All I can see is iOS6 style components. I can compile on iOS7 and it will bring up the keyboard in iOS 7 but none of the drag and drop components from firemonkey are iOS7 style. Am I missing something obvious? > {quote:title=David Templar wrote:}{quote} > It says here http://www.embarcadero.com/products/rad-studio/whats-new that XE5 has "iOS 7 SDK support and style" > > Where is the iOS7 style? - All I can see is...

FireMonkey TEdit control / TabItem Transitions
I tried to set the "TextPrompt" property in a TEdit - does this work? Also, does anyone know if there are any other ChangeTabAction transitions other than slide sideways such as flip or slide up - down? Thanks - Davis, ...

Web resources about - Change a control matrix in firemonkey - embarcadero.delphi.firemonkey

Firemonkeys - GamesIndustry International
The world's leading games industry website. Get insight from todays industry leaders with news, interviews and analysis of global gaming trends. ...

Firemonkey’s Real Racing 3 To Launch At The End Of February
In September, Apple demoed Firemonkey’s Real Racing 3 at the iPhone 5 event . Three months later and the game has yet to show up in the App Store. ...

EA Games and Firemonkey Bringing Real Racing 3 to Android, Fasten your Seat Belts
Start up your engines race fans, EA Games is teaming up with Firemonkey to bring Real Racing 3 to mobile devices. If you’re a fan of more realistic ...

EA's Firemint and IronMonkey Studios Merge to Become FireMonkeys
... game development studios into one mega-studio in Australia. Firemint and IronMonkeys will be merged into a single studio now known as Firemonkeys ...

News: Firemonkeys announces Real Racing 3
Firemonkeys, a new gaming subsidiary of Electronic Arts born from the merger of FireMint and IronMonkey, has announced the coming release of ...

firemonkeys - iMore
EA has pushed out another impressive update to its equally impressive iOS racer, Real Racing 3, that for the first time brings cars from Ferrari ...

Firemonkeys on Real Racing 3 going free-to-play
... got a hands-on preview of Real Racing 3. We also spoke with Ptolemy Oberin, one of the game’s programmers and project lead at developer Firemonkeys, ...

Real Racing 3 coming in 2012 from Firemonkeys
The first game from recently merged developer Firemonkeys is Real Racing 3 , the developer revealed moments ago during EA's Summer Showcase event ...

Firemonkeys Previews Real Racing 3 for iPhone and iPad
Firemonkeys, the new combined studio from EA combining the IronMonkey and Firemint gaming studios, has announced the development of Real Racing ...

EA Mobile Moves: IronMonkey & Firemint Merge Into “Firemonkeys,” Now Have 50M Players Between
... that it is merging two top mobile game studios, IronMonkey and Firemint , which will fittingly combine to create a new company, called Firemonkeys. ...

Resources last updated: 12/18/2015 12:13:21 PM