Now I adapt my app for tablet PC. I ask how can I fixate form when the screen was rotated. Good people says that I must adapt my app for portrait orientation and they're right.
Some forms is very specific and it's very hard (maybe impossible) to re-design they for portrait orientation. So I think I can create a illusion that my app works only in landscape orientation.
That's why I need rotate standard VCL components in Delphi XE2. For example for standard memo I need write text not only from left to right (or right to left) and from up to down (and from down to up).
Also I need rotate button. Now I use standard TButton and TRxSpeedButton.
I think enough to rotate the text for TButton but I don't know how I can do this?
In case of TRxSpeedButton I use glyphs. In theory maybe I can override canvas and change pic. Another way is create 2 buttons (one for portrait orientation, one for landscape. Each one will have their special glyph) and change their visibility. But I don't like 2nd variant because in this case exe file will be very plump, I don't like plump exe))
Thanks for advises.
One way that might work for you would be to use the
PaintTo
method of various controls. Have them paint their fully drawn image onto a bitmap and then rotate the bitmap by 90 degrees to get the portrait versus landscape effect. Then draw that image on the canvas of your form in itsOnPaint
method (you would want to make the actual controls invisible when in the portrait mode, showing only your painted and rotated bitmaps.)There are some controls (like
TRichEdit
) whosePaintTo
Method doesn't work correctly, though. So this may be of limited use for you. Another way is to grab a screen capture of the entire client area of the form on the desktop and then rotate and display that. that works even withTRichEdit
...