#VB Technical Questions
4 messages in this thread
I have three technical questions for a charting component of an
application:
1. is it possible to print text vertically i.e. rotate it by 90
degrees?
2. If I have a picture box which I have used methods to draw to, how
can
I copy the contents of the picture box to the clipboard as a
metafile? Just using the metafile parameter (3 I think) doesn't
seem
to work.
3. I know it is possible to pass a control into a procedure and have
methods performed on that control but is possible to define a
procedure that can draw the same image on a picture box OR a printer
object? I'm sure this must be a common requirement for routines to
print charts or reports.
Regards… Graham
There is 1 Reply.
Graham,
1. Vertical Text. Yes, use the Print method to print your text in a
picture box and then use StretchBlt to flip it. it's not too flexible but
you can do some neet stuff.
2. No. the graphic methods are creating a bitmap, *not* a metafile.
You need to "play" you graphic commands into a memory metafile using API
calls.
3.No. This is unfortunate but I don't think you can pass either a
control or a printer object to the same procedure. On option is to write a
routine to takes both a control and a printer as an paramter and then a
final "flag" prameter that says which one to manipulate. The best solution
probably is to pass the .hDC and use api functions to do your graphics.
-=Jonathan
There is 1 Reply.
Jonathan,
I don't think StretchBlt can rotate 90 degrees. You can flip (mirror) it
horizontally or vertically, but there's simply no way to get it to be
rotated 90 degrees. Gotta use a 2-d transformation matrix for that
(something I'm working on).
– Ted
There is 1 Reply.
Ted,
Thanks for the info. I haven't messed with StretchBLT that much.
Looking forward to seeing your technique for graphic rotation. -=-
Jonathan