It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I have to make the background (of desktop) blur when i open my app.how do i do this please help me out with hints or links..
Take a screenshot.
Apply some blurring to the screenshot bitmap (e.g. Gaussian).
Display a fullscreen window with processed screenshot as content.
Show your window on top of the fullscreen window.
The details depend on the OS and the technology you are working with.
If dimming instead of blurring is OK, you can just show a black fullscreen rectangle with alpha less than one (as suggested in the answer by Seçkin).
Though I must add that as a user I would resent an application doing that to me. Unless it's a nuclear missile launch control application (or something with similarly drastic consequences of a user mistake), I'll just uninstall it.
If I were you, I would create a semi-transparent rectangle which spans entire screen to achieve this effect. It is similar to see behind blurry glasses: World is not blurred, just glasses make it perceived blurry.
Related
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I need to develop a Maya Viewport Extension in C++ with(MFC),also need to control view style(such as top view, left view etc.).Can I use Maya SDK to archive this and how to make it?Thanks.
I'm not perfectly sure what you mean by "Viewport Extension".
I guess you're trying to write a Maya Plug-In that features your own type of viewport, which is commonly called "Model View".
MCF does not have anything to do with this.
You use Maya MEL/Python commands to create Maya windows, panels and other UI-elements.
(if there is a hack to make Maya work with windows you've created yourself, I don't know it).
You can develop custom viewports in Maya by creating two classes:
A viewport or model view, and a "model editor command".
Model View
One is your viewport class, let's call it "MyViewport".
It has to inherit "MPx3dModelView".
Normally you will associate a camera with the viewport. This let's you control from where you see the scene. You can have multiple cameras connected to your viewport (multi-pass display, for example stereo 3D), or none at all (but then you must set all rendering parameters by yourself, which can be tedious).
The (callback) functions you inherit from that class allow you to set up the details for your viewport.
See the Maya documentation on MPx3dModelView to see how to use it.
http://download.autodesk.com/us/maya/2010help/API/class_m_px3d_model_view.html
Model Editor Command
The other class you'll need is a viewport command.
That is the thing that get's called when someone tries to create your viewport.
It has to inherit "MPxModelEditorCommand".
It's most important feature is that it can create an instance of your Model Editor class.
See the Maya documentation on MPxModelEditorCommand on how to use it:
http://download.autodesk.com/us/maya/2011help/API/class_m_px_model_editor_command.html
Registering the viewport command with the Maya plug-in
In order to be able to create your viewport, you must register your Model Editor Command with the plugin.
In your initializePlugin function (the one you export with the plugin)
MStatus initializePlugin( MObject obj )
{
MFnPlugin plugin( obj, PLUGIN_COMPANY, "1.0", "Any");
plugin.registerModelEditorCommand(MyModelViewCmd::commandName, MyModelViewCmd::creator, MyModelViewCmd::createModelView);
}
Writing a script that creates your viewport
Finally, you use MEL or Python scripting in Maya to create your user interface.
In the most simple set-up, you simply create a window and then call your model editor command to create you custom viewport in this window.
window MyWindow;
paneLayout MyWindowPane;
MyModelView MyModelView1;
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Frameworks like Qt and GTK+ offer to developers some standard user controls like editboxes, comboboxes, etc. But many GUI-applications have more complicated user controls. For example, text editors have areas where user can input text and insert images or tables. Audio editors usually display waveforms of audiotracks, volume indicators, etc. My question is how such controls are drawn? Moreover, these controls usually can handle events - for example, tables in text editors can be selected, on right mouse button click some context menu pops up, etc. So, problem is not only to draw these controls, but also to make controls handle events. I have only idea to use Canvas or OpenGL, but I suspect that it would be difficult to implement events handling. May be, there are more simple ways to draw user interface?
This is a pretty vague question, so this will be a somewhat vague answer. In general, most of this work has already been done. For example, Qt already has a text view class, an image class, and a table class (I'm not very experienced with Qt, just going from general stuff I know). For the text editor you are talking about, you might derive a class from a Qt text editing widget which has a handler to accept the dragging of images and can draw them. Again, Qt already has the code to draw images and do all kinds of painting.
To draw an audio waveform, you would have some sort of box or widget (generally speaking) that would draw a vertical line for each sampling interval to represent the volume or amplitude there.
Yes, OpenGL would be overkill for what you are talking about here because you would need to somehow write your own event handling, whereas most GUI frameworks do that for you. Again, a rather vague answer for a vague question, but I hope it helps!
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I'm not sure if this is something that is possible. But basically the gist of what I need is that a bunch of stuff in my Win32 program is drawn to hWnd through a device context during WM_PAINT. Then through a separate function, I have more stuff drawn to hWnd through the SAME DC. Unfortunately since I use the same DC, the stuff drawn during WM_PAINT is still held in the DC, and is therefore subsequently copied again through my function.
What I need to do is clear the contents of my device context at the end of WM_PAINT or the beginning of my function so that the stuff isn't copied twice.
Why cant you do the entire drawing in WM_PAINT handler ?in the second drawing how do you draw?may be using GetDC to get the device context and draw, right?
The problem is that when you draw outside the WM_PAINT handler, it get erased when the window need to repaint, and the WM_PAINT drawing trump your GetDC based painting, unless you use a bitmat to keep the current context's content
Do all of your drawing to an off-screen bitmap whenever you need to while outside of WM_PAINT, then simple copy the current bitmap to the HWND inside of WM_PAINT.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
Say for example that I wanted to draw a red square (or multiple red squares) in the middle of the screen and still be able to see everything not covered by the square, a little bit like a splash screen.
I want to implement this in windows but I don't know the best way to draw on top of the screen. These are my ideas so far:
I initially attempted to draw directly onto the desktop by obtaining a Device Context for it.
Make the rectangle/s a separate window as they would be very easy to move around and I wouldn't have to worry about transparency.
Create a transparent window that covers the entire screen and stays on top. Draw the rectangle/s on the client area of the screen
I think that the best of the 3 ideas is the last one, but any opinions on my ideas, or new ideas would be much appreciated :)
Creating transparent window, then drawing in it, in my experience it is messy.
Why don't you just take a screenshot from the back ground set it as the back ground for you snake game. When ever they click somewhere/die you just close your game.
You could catch the last click and resubmit it after closing the game.
That is how I would do, but of course that just an opinion.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I want to change background button when mouse move or mouse leave or click on button. I write my app in MFC.
Please help with demo/sample.
How to track mouse movements? See here
How to change the bitmaps of the MFC buttons? See here