0

This feels like it should be much easier to do than it is, but I've researched every link I could find and nothing works.

I'm trying to make an application for digital drawing. It floats above photoshop and appears with the middle click and gives me easy access to shortcuts, so it needs to be able to rotate 90 degrees for when I using my tablet landscape vs portrait.

The closest I got used bitmaps but of course then I can't press the buttons. Nothing using OnPaint and e.Graphics.Rotate and Matrixs have worked but I"m not sure if they were even supposed to work in this instance.

Apparently this is easy to do in WPF but I'm not going to rebuild it again for what would be the 4th time. If there is no way to cleanly rotate it (for some silly reason) then I'll probably just have to make an algorithm for switching the button functions and images and rotating them, or just duplicating the form and making rotated icons. Either way it's a big pain for what feels like what should be a base functionality.

AustinWBryan
  • 3,249
  • 3
  • 24
  • 42
  • 1
    So you want to rotate by 90° or arbitrary angles? BTW: Wrt 'base functionality' : Can you think of even one windows program that lets you rotate its layout? I can't. Best use two layouts (vertical & horizontal) ; Do you want the texts to rotate as well? Not well supported in winforms without owner-drawing them.. Wrt Bitmaps: You should be able to click them and find the button you would have hit if there was one. And if you really want to you can even fake the button animatons in the mousemove/down/up events.. – TaW Jul 06 '20 at 08:04
  • Just 90* And my application is more of an onscreen widget where these kinds of rotations would be more common. Coming from Photoshop to Visual Studio I was really frustrated how hard it is to do stuff like rotate and change opacities, or gibing a button a color tint. It's very inconsistent overly complicated for what is basic stuff. I didn't mean basic as in the basic stuff you'd expect to find in every application, but basic as in it's simple concepts that I'm really surprised aren't built in because of how simple they are, and how basic they are in Photoshop and game engines. – AustinWBryan Jul 06 '20 at 08:29
  • @TaW I could try again with the Bitmaps, but last time I tried, I couldn't tell the buttons were being pressed because the buttons don't change their color when they're clicked. Also, I'm pretty sure that the original buttons wouldn't line up with the image buttons after the flip because the physical buttons haven't moved yet. There isn't any text in the buttons, which I'd hope would make things easier. – AustinWBryan Jul 06 '20 at 08:33
  • Not having text on the button indeed makes it much easier. Are the buttons (somewhat) square? Maybe you can add an image to the question? Is the layout (somewhat) regular or are they placed with intricate spacings? A FlowLayoutPanel will fill the buttons into any given size, so that would be a simple solution if they are of the same size.. You would create a second set of icons and when rotating exchange them. – TaW Jul 06 '20 at 08:36
  • For your question, This is similar to the question asked here: [https://stackoverflow.com/questions/1864180/rotating-a-net-panel-in-windows-forms](https://stackoverflow.com/questions/1864180/rotating-a-net-panel-in-windows-forms). The quick summary of answers from that question is that while it may be possible to do it, it would be very, very complicated. – Jack J Jun Jul 07 '20 at 06:00
  • Thanks for the help guys, I did eventually end up just recreating the program in WPF, to get the rotation feature that I needed. – AustinWBryan Aug 28 '20 at 22:00

0 Answers0