How to draw on screen using RealBasic, Visual basic? Where i have one default laptop screen and second monitor - realbasic

I have my laptop default screen and second screen. How can I write RealBasic, VisualBasic (Java not possible) application which can allow me to paint on desktop (both screen)?

Most likely you won't be able to draw directly to the screen, but you could potentially grab screenshots of each screen and then draw onto those. Depending on what exactly you're trying to do with your application, it would almost definitely be a more realistic goal to grab a screenshot of each screen and then simply display the screenshots in standard windows that take up the entire screen, letting you then edit and "draw" onto the screen there.
Another option would be to create a transparent window, and then intercept mouse clicks and present information on that window.
If you're using RB on a Mac, you can use the Monkeybread Software Plugin to create a NSWindowMBS and modify the alpha value or an OverlayWindowMBS. It looks like you're trying to do this on Windows, though, so this won't work.

Related

How to create a global overlay for MacOS?

I am trying to develop a MacOS application using Xcode and Cocoa. My intent is to create an overlay on the user's screen that is mostly transparent, and does not register input. For example, an application like f.lux tints the colour of your entire screen like a global overlay, but you can still click on-screen items, as mouse clicks go right through (assuming that it's an overlay). How can I get started with achieving a similar overlay/widget?

MFC IVideoWindow put_FullScreenMode works incorrectly

So I have next problem:
I have two monitors and do video translation from web camera on one of them(secondary). I do it in full screen mode using
put_FullScreenMode().
It works fine but when I click any mouse button on area of primary monitor, window with video translation wrap into just window mode.
How can I save full screen mode working with primary monitor?
At the first, I move my video to the left (on secondary monito from primary) and use full screen mode.
if(monitors.GetCount() > 1)
gx.pVW->put_Left(primaryRect.right);
gx.pVW->put_FullScreenMode(OATRUE);
gx.pVW->put_Visible(OATRUE);
Thank you for your time.
[Much] older applications took advantage of FullScreenMode since API supplied a specific "full screen renderer" filter which efficiently took care of full screen presentation. Since then video adapters found their way into stretching of presented video and full screen mode become unnecessary. Windowed mode of video renderer (you are using) was also not a recommended mode compared to windowless any longer.
You would be better off using renderer in windowless mode right in your UI, in your window, form or dialog. Using borderless window hosting video renderer you can easily imitate full screen mode without actually change of display mode. Such window remains normal window and does not need to go back from full screen with another UI activity, e.g. such that happens on another monitor.
VMR filters themselves demonstrate the two ways of going fullscreen in their Filter Config property page:
Set Fullscreen does it the way you do and suffer from the mentioned issue. The other method does full screen mode using borderless window stretched to the extent of a monitor.
See also related discussion:
IVideoWindow::put_FullScreen returning only native video size

Animate Windows Wallpaper with QT

i want to make an animated wallpaper for windows. So far i have only expreience with Mac OS X programming and i'm new to windows. So i decided to work with QT because it seems that there is more help out there.
Until now i have created the app in a borderless window in qt. It work quiet fine.
But is there a way in QT to change the level of the window so that its appear above the windows wallpaper but behind the icons?
EDIT:
Ok if found a simple solution.
After some testing with the hints form kusg1 I figured out when there is a transparent window mouse events going still to the desktop.
I actualy want have this website has wallpaper: Ticketack. - So i created a frameless window which stays on bottom and has a transparent background and displays the text. Beside this i can change the windows wallpaper directly to get the background of the clock.
So clock text is not behind the icons but i think this will be ok.
Just some ideas: Use the windows flag as Qt::Window | Qt::FramelessWindowHint + Windows Stay at bottom hint, and set the content of the widget with your animated content (the suitable candidate is to use QGraphicsView).
The widget needs two main tasks:
Upon launching, it grabs the desktop background as pixmap and do overlay with the animated content (this needs to have the desktop to be wallpaper-less for simple scenario).
The widget needs to capture mouse and focus event and channel back to actual window command if the user wants to click the icon on the desktop.
Update:
Some pointers for the implementation:
For managing desktop icon, there is a good article here! (also found from SO).
Qt example and demos has an example on the taking desktop snapshot, the snippet is: QPixmap::grabWindow(QApplication::desktop()->winId());
Answer to your question: no, there isn't.
However, you can try something like this using Windows API: How to draw directly on the Windows desktop, C#?

Windows Mobile 6.5 - camera life preview and image capture using my own dialog

Im writing an application for workers in our factory and one of requirements is that they should be able to take images using camera integrated in PDA with WM6.5.
The main difficulty is, that thay MUST NEVER EVER be able to enter windows, Start button, desktop etc. They are allowed ONLY to see my fullscreen application.
I succesfully deactivated BlueTooth + red, green and volume buttons (if you are interested, im pasting links here)
http://forum.xda-developers.com/showthread.php?t=546737
http://msdn.microsoft.com/en-us/library/bb431750.aspx
http://social.msdn.microsoft.com/forums/en-US/vssmartdevicesvbcs/thread/a4f9f41d-47a8-4080-8613-2c2ddcf4c012/
And now I have to implement the camera function. But as CameraCaptureDialog opens a new dialog and shows start button, task bar and allows user to open list of applications, I must not use it.
I must create my own dialog that will show the Live Preview in a panel or in an imageBox and photo will be taken using a button.
I searched the whole internet and found only DirectShow.NETCF (but people do not recommend it) and CameraCaptureDialog.
Can I somehow redirect the CameraCaptureDialog to my dialog? Or can I access camera directly via .NET framework? Or can I modify the CameraCaptureDialog not to show Start button, menu etc?
Looks like you have a bit of a challenge. I agree that Directshow is a questionable solution, but it may be your only option. I did get http://alexmogurenko.com/blog/directshownetcf/ to work, but only on low resolutions.
A better option might be to find a device that does not show the menu bar/start button. AFAIK, the HTC HD2 has a very clean Cameracapturedialog..
Good luck.

How does a Windows non-native user interface work?

Through experience I have found that the native windows forms/components don’t like to be changed. I know using Delphi or Visual Studio you are given native windows components to populate a form or window with and then you attach code on events that these components may do (onClick for example).
However, how do all of these programs like Word or google’s Chrome browser alter the standard windows’ window? I thought it was somehow protected?
Chrome seems to have tabs actually on the window’s frame?
I know you can also get toolkits like Swing and QT that have their own controls/components to populate a form. How do these work? (How does the operating system/computer know what a non-native button should act like? For example; Chrome's back and forward buttons, they're not native components?).
I can understand how OpenGL/DirectX window would work because you’re telling the computer exactly what to draw with polygons/quads.
I hope this question is clear!
Windows does not protect GUI elements. Windows and controls can be subclassed to handle various drawing operations in a custom way. For example, windows may override and reimplement the handling of the WM_NCPAINT message to draw a custom titlebar and frame:
http://msdn.microsoft.com/en-us/library/dd145212(VS.85).aspx
Some Windows controls have an "owner-draw" mode. If you use this, you get to draw the control (or at least vital parts of the control), while Windows takes care of responding to user input in the standard way.
Swing ant QT draw their own widgets at a low level using basic primitives, but they also have theme engines which can mimic the native controls.
Qt moved to native controls a while back. As for how swing does it, it gets a basic window from the OS. Then much like Opengl\Directx it does all of the drawing with in that window. As for where to position things that is what the layout managers do. Each manager has a layout style horizontal, vertical, grid, components it has to draw and a section of window it is expected to fill. From there it does some pretty easy math to allocate its space to its controls.
There's no magic: non native controls are simply drawn on a blank window. Or, instead of being drawn they may be represented as one of several bitmaps based on state (ie: a button may be represented as a .png for the normal state, another .png for the pressed state, etc)

Resources