Page 1 of 1

Upside down screen.

Posted: Wed Aug 11, 2010 4:40 pm
by Lewis
Hello, I would like to know how to flip my screen upside down, Or if i can, a webbrowser. But if it is the webbrowser, i want the flash to flip upside down aswell. Even better: Something were a flash player would be upside down :D

Re: Upside down screen.

Posted: Wed Aug 11, 2010 7:15 pm
by mandai
There isn't an easy way to do this since the webbrowser does not provide a Paint event or a way to get a Graphics object from it (plus activex controls like flash would have their own window drawing routines that would need to be altered in some way as well).

Controls like buttons and labels should work fine with this though:
Code: Select all
    Private Sub upsideDownPaint(ByVal sender As Control, ByVal e As System.Windows.Forms.PaintEventArgs)
        Dim bmp As Bitmap = New Bitmap(sender.Width, sender.Height)
        sender.DrawToBitmap(bmp, New Rectangle(0, 0, bmp.Width, bmp.Height))
        Dim m As Matrix = New Matrix()
        m.RotateAt(180, New PointF(bmp.Width, bmp.Height))
        e.Graphics.Transform = m
        m.Dispose()

        e.Graphics.DrawImage(bmp, New Point(bmp.Width, bmp.Height))
        bmp.Dispose()

    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        For i As Integer = 0 To Me.Controls.Count - 1
            AddHandler Me.Controls(i).Paint, AddressOf upsideDownPaint
        Next
    End Sub

Re: Upside down screen.

Posted: Wed Aug 11, 2010 7:28 pm
by Lewis
Would that work if i added a flash object?