Build Your Own Arcade Controls Forum
Main => Software Forum => Topic started by: DaOld Man 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..
-
I would ask your question at www.vbcity.com
I always get my answers there ...... good luck
-
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:
-
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 (http://www.xtremevbtalk.com/showthread.php?t=25347) 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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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++??
-
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++.