The good
XFORM STRUCT
eM11 REAL4 ?
eM12 REAL4 ?
eM21 REAL4 ?
eM22 REAL4 ?
regEdx REAL4 ?
eDy REAL4 ?
XFORM ENDS
The windows.inc structure,
XFORM STRUCT
eM11 DWORD ?
eM12 DWORD ?
eM21 DWORD ?
eM22 DWORD ?
ex DWORD ?
ey DWORD ?
XFORM ENDS
I think hutch has said before that he prefers to use DWORDs for everything API related. That may be the reason for this difference.
Out of interest, what is XFORM used for?
Cheers,
Zooba :U
The XFORM is used for graphic Transformation with the SetWorldTransform API.
Some applies
Drawing graphics with predefined units.
Centering graphics in the application's client area.
Scaling graphics output to half its original size.
Translating graphics output 3/4 of an inch to the right.
Rotating graphics 30 degrees.
Shearing graphics output along the x-axis.
Reflecting graphics output about an imaginary horizontal axis drawn through its midpoint.
To load the structure i do like that but perhaps is there more simple.
invoke StrToFloat,SADR("0.8660"),addr ChargeReal
fld real8 ptr ChargeReal
fstp real4 ptr xForm.eM11
ToutEnMasm
.elseif case == TRANSLATE ;Translate right by 3/4 inch.
xForm.eM11 = (FLOAT) 1.0;
xForm.eM12 = (FLOAT) 0.0;
xForm.eM21 = (FLOAT) 0.0;
xForm.eM22 = (FLOAT) 1.0;
xForm.eDx = (FLOAT) 75.0;
xForm.eDy = (FLOAT) 0.0;
SetWorldTransform(hDC, &xForm);
break;
Wow. That's cool! I never knew about that. Then again, I don't spend much time playing with GDI (I assume it's GDI).
There are macros out there that will let you simply write the number, rather than convert it from a predefined string. Some will store it as a constant (in .data or .const) and others embed it directly into the code. I'm quite certain that REAL4 is typedef'd to DWORD, though some (Microsoft) debuggers apparently will automatically display a REAL4 as floating point.
A quick example of a macro:
movr4 MACRO dest, src
mov dest, 0BADF00Dh ; make sure it's using a full DWORD move
ORG $-4
REAL4 src ; now overwrite with our real number
ENDM
You can substitute DWORD for REAL4 and it will still work the same.
Cheers,
Zooba :U
Thanks,I was searching for a best method.
ToutEnMasm*