Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Rotate screen with VB6  (Read 3855 times)

0 Members and 1 Guest are viewing this topic.

DaOld Man

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5165
  • Last login:Yesterday at 02:14:21 pm
  • Wheres my coffee?
    • Skenny's Outpost
Rotate screen with VB6
« on: September 08, 2006, 10:56:10 pm »
Hi all..
I was wondering if anyone on here knows how to rotate the screen output in VB6.
I have been told it cant be done from withing VB6 itself.
TIA..

unclet

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3561
  • Last login:March 17, 2025, 11:51:15 am
Re: Rotate screen with VB6
« Reply #1 on: September 09, 2006, 02:30:49 pm »
I would ask your question at www.vbcity.com

I always get my answers there ......  good luck

DaOld Man

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5165
  • Last login:Yesterday at 02:14:21 pm
  • Wheres my coffee?
    • Skenny's Outpost
Re: Rotate screen with VB6
« Reply #2 on: September 09, 2006, 02:39:19 pm »
Thanks, I dont see anyway to rotate the screen output, however there were a few posts about rotating images. What I really need is to rotate the screen output.
Interesting site though, I added it to my favorites for future reference..
 :cheers:

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Re: Rotate screen with VB6
« Reply #3 on: September 09, 2006, 10:17:29 pm »
Your right it's not really possibly to rotate the screen at any decent speed with VB6. You can capture the screen by getting a handle to the screen's window by using GetDesktopWindow(). But even if you use Direct Memory Access to rotate the bits it will still be a slow affair. Direct Memory Access is the fastest way to manipulate a image's pixels using VB6 AFAIK.

The only other method I can think of would be to use Direct3D and write the graphics to a textured quad and rotate the quad. This method in iself would open a can of worms of problems and your limited to texture memory sizes.

The only practical way to rotate the screen is using software like iRotate or PivotPro because they use the video card's driver to do the rotation so it's very fast.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19431
  • Last login:Today at 02:08:41 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Rotate screen with VB6
« Reply #4 on: September 10, 2006, 02:31:55 am »
Those methods don't work particularly well either because they don't always work on directx-based applications (read mame). 

Modern video cards support native rotation.  That is really the only way to go if you need to rotate everything in windows. 

Minwah

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7662
  • Last login:January 18, 2019, 05:03:20 am
    • MAMEWAH
Re: Rotate screen with VB6
« Reply #5 on: September 11, 2006, 06:33:20 am »
Those methods don't work particularly well either because they don't always work on directx-based applications (read mame). 

With respect to something like a FE, where only the FE itself need be rotated, would it be possible?  I know it's hard/impossible to rotate the screen with the GDI....but I assumed it to be realistically possible using DirectDraw/3D.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19431
  • Last login:Today at 02:08:41 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Rotate screen with VB6
« Reply #6 on: September 11, 2006, 06:48:19 am »
Well with these exdternal apps it's the opposite.  Gdi apps rotate easily (because the apps hack the kernel basically) but that can't be done in non-gdi apps. 

Rotation on a 3d based application can be done internally fairly easily, not so much with a 2d one, even if it's direct draw based. 

youki

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1612
  • Last login:November 19, 2016, 01:07:33 pm
  • Atomic Front End Creator
    • Atomic Front End
Re: Rotate screen with VB6
« Reply #7 on: September 11, 2006, 07:41:33 am »
Quote
but I assumed it to be realistically possible using DirectDraw/3D.

I use DirectDraw and i rotate the Fe Screen.  But i use direct memory access. (as for my alpha blending).

DirectDraw have routines to Rotate and Alpha blending.  But these routines only work if your videocard has the hardward support for that. And unfortunaly most of current video card didn't have it. (for DDRAW , they have it for D3D)    >:(   

But if you need to simply Mirror or Flip the screen , DDRAW support that via the blt function without the need to have the hardware support.




headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Re: Rotate screen with VB6
« Reply #8 on: September 11, 2006, 08:17:40 am »
I didn't realise this was for a FE, since he never mentioned that. I just thought he wanted to rotate the entire display.

Tom also uses DirectDraw in GameEx and I helped him code the rotate routines using C++. The handle to the Direct Draw surface is passed to the C++ dll and the API functions GetDIBits() and SetDIBits() are used to read the bytes into an array which is then rotated based on the bit depth then the bytes are written back.

Using this method the speed is reasonable on a medium spec machine with screen resolution limited to 800x600 and 16 bit colour.

DaOld Man

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5165
  • Last login:Yesterday at 02:14:21 pm
  • Wheres my coffee?
    • Skenny's Outpost
Re: Rotate screen with VB6
« Reply #9 on: September 11, 2006, 07:30:23 pm »
Actually the need for this was not for a FE. (But it could be in the future.)
I wrote a program in VB6 to allow you to make favorites lists in GLaunch (which is a FE).
Glaunch can be rotated, but my program cannot be, so it makes it kinda useless if your machine has the rotated screen.
Here is a link that decribes my program, if anyone's interested in it:
http://members.tripod.com/~Skennys_Outpost/MenuMaker.html
Thanks to all who commented. I have pretty much resolved that it cant be done in VB6, not very easily anyway.
Maybe I should learn C++??

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Re: Rotate screen with VB6
« Reply #10 on: September 11, 2006, 11:27:23 pm »
Actually the need for this was not for a FE. (But it could be in the future.)
I wrote a program in VB6 to allow you to make favorites lists in GLaunch (which is a FE).
Glaunch can be rotated, but my program cannot be, so it makes it kinda useless if your machine has the rotated screen.
Here is a link that decribes my program, if anyone's interested in it:
http://members.tripod.com/~Skennys_Outpost/MenuMaker.html
Thanks to all who commented. I have pretty much resolved that it cant be done in VB6, not very easily anyway.
Maybe I should learn C++??

Looking at your program it is just a basic VB6 form application. To do proper rotation you would really need to be using DirectX. But even if you override the OnPaint event and capture your window using the hwnd and rotate the bits of the form then display them onscreen using a picturebox or something, you have the arduous task of relaying the button events to match up with their new rotated positions. It's quite a task to do even in C++.