473,324 Members | 2,257 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Rotated form?

Odd question:

I have some Forms that I have to display rotated 90 degrees clockwise (don't
ask! :-)

Right now I'm doing it by hiding the Form offscreen, grabbing the DC,
rotating it and blitting it onto another Form's DC (well actually a
PictureBox).

Currently I have to handle all event forwarding myself.

Is there a better way to approach this?

Jamie
Nov 17 '05 #1
4 1928
Hi Jamie,

Perhaps you might consider WPF aka Avalon if you don't need it right now.

--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

"Jamie Border" <ja***@jborder.com> wrote in message
news:dk**********@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com...
Odd question:

I have some Forms that I have to display rotated 90 degrees clockwise
(don't ask! :-)

Right now I'm doing it by hiding the Form offscreen, grabbing the DC,
rotating it and blitting it onto another Form's DC (well actually a
PictureBox).

Currently I have to handle all event forwarding myself.

Is there a better way to approach this?

Jamie

Nov 17 '05 #2
Unfortunately the way you're doing it is the best method. Usually the
orientation of the form is a function of the low-level driver software. This
can be controlled on Tablet PC systems for example but not for other types
of systems unless you can get a custom driver.
--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Jamie Border" <ja***@jborder.com> wrote in message
news:dk**********@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com...
Odd question:

I have some Forms that I have to display rotated 90 degrees clockwise
(don't ask! :-)

Right now I'm doing it by hiding the Form offscreen, grabbing the DC,
rotating it and blitting it onto another Form's DC (well actually a
PictureBox).

Currently I have to handle all event forwarding myself.

Is there a better way to approach this?

Jamie

Nov 17 '05 #3
Bob Powell [MVP] wrote:
Unfortunately the way you're doing it is the best method. Usually the
orientation of the form is a function of the low-level driver software. This
can be controlled on Tablet PC systems for example but not for other types
of systems unless you can get a custom driver.
Unfortunately I am tied to one particular driver, so no custom rotation
in driver code for me, otherwise I would be merrily re-writing the
graphics driver.

I should have mentioned - these Forms are "fullscreen", that is:

* They are (design-time) 768x1024 and (rotated) 1024x768
* No non-client stuff (no frame, no title bar etc.)

The problem is that the (original) Form is created at 768x768 (square).

This means that after I rotate it I am left with a blank area 'outside'
the Form.

The form is built offscreen, but I can't seem to tell it that being
bigger than PrimaryScreen.Bounds is what I want.
I've tried sending the Form WM_SIZE et al, but to no avail - it seems
the Control gets a WM_SIZING or some such and changes my "768x1024" to
"768x768".

Is there a way to override this somewhere? I feel that I am fighting
the system somewhat.

Jamie
--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Jamie Border" <ja***@jborder.com> wrote in message
news:dk**********@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com...
Odd question:

I have some Forms that I have to display rotated 90 degrees clockwise
(don't ask! :-)

Right now I'm doing it by hiding the Form offscreen, grabbing the DC,
rotating it and blitting it onto another Form's DC (well actually a
PictureBox).

Currently I have to handle all event forwarding myself.

Is there a better way to approach this?

Jamie


Nov 17 '05 #4
Would definitely like to do this, but unfortunately, is needed
yesterday.

Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: rzed | last post by:
I'm using PIL to generate some images which may be rotated at the user's option. When they are rotated, the original image is cropped in the new image (which is fine), and the corners are black...
2
by: Gnurp Gnarp | last post by:
When the number of columns get large, it becomes increasingly difficult to view the results of a select in a small window (e.g. 80 line xterm) because of line wrapping. Can I have the results of...
6
by: charsh | last post by:
Hi, I using the code below to draw a text in a pictureBox1. //Start--------------------------------------------------------------- private void button1_Click(object sender, System.EventArgs e)...
1
by: kurt sune | last post by:
I am trying to do a rotated font. I get a handle alright which I convert to a font-object by Font2 = Font.FromHfont(handleFont) g.DrawString(Text-to draw, Font2, Brush, CurrentX, CurrentY) ...
2
by: Tilo Pätzold | last post by:
Hi Everybody (especially Microsoft), we build EMF files with rotated text for export to office (powerpoint, word). It is planned that the text can be edited in the office document. Without the...
0
by: Khadim | last post by:
Hi, I am facing a problem in my application. I have an image on which there are many numbers present. I can find the pixel position of the center of those numbers. Now I have the names of those...
5
by: austincollins | last post by:
I have been searching for hours to find a solution to display text rotated at 90 degrees in firefox, and could not find one. css3 and IE has the css command "writing-mode: tb-rl;" but this does not...
7
by: halo combat22 | last post by:
I need help on a project i was assigned. I need a way to recognize these numbers. Any help is appreciated.
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.