Home > Back-end >  Questions about TValue and TBitmap
Questions about TValue and TBitmap

Time:09-27

Environment: XE7 Firemonkey

I made a Style for a Button, and then want to dynamically in the process of assignment to the Style of the property
Like this:
BtnImage - & gt; StylesData [" imagestyle "]=TValue: : From (" Wnd_Close. PNG ");
BtnImage - & gt; StylesData [" backgroundrectanglestyle. Opacity "]=TValue: : From (0.6);
BtnImage - & gt; StylesData [" backgroundanicolor StopValue "]=TValue: : From (claRed);
But if TBitmap this is wrong, should be TValue: : From not using pointer
Button2 - & gt; StylesData [" circlestyle. The Fill. Bitmap. The Bitmap "]=TValue: : FromBut in Delphi is
Button2. StylesData [' circlestyle. The Fill. The Bitmap. The Bitmap '] :=TValue. From (ImageControl1. Bitmap);
This should be how to deal with?

CodePudding user response:

Not so used

CodePudding user response:

I tried the
This
Int * iSrc=https://bbs.csdn.net/topics/new int ();
* iSrc=https://bbs.csdn.net/topics/10;
TValue val=TValue: : From/////////////////////////////////////////////////////////////////
Int * iDst=new int ();
Val. ExtractRawData (iDst);//error Invalid class typecast
But if A change to do like this was no problem
TValue val=TValue: : From (* iSrc);
I watched the Delphi TValue code below, it is a pity to be unfamiliar with Delphi, can only guess that is the question of pointer
Would like to if I can
Button2 - & gt; StylesData [" circlestyle. The Fill. Bitmap. The Bitmap "]=TValue: : From (ImageControl1 - & gt; Bitmap);
Results the compiler and tip:
[bcc32 Error] MainFormUnit. CPP (28) : E2459 Delphi style classes must be constructed using operator new
I don't know the zha a whole

CodePudding user response:

No one met the similar problem?

CodePudding user response:

Call demon elder brother ah ~!!!!!!!!!!
  • Related