I'm Trying create a menu like windows 8 start menu (metro)
its not hard to create buttons (i mean those special buttons that you all saw in metro style with image and description text) and do some animation for them like when mouse over the text change and show full description . i create those was not hard but ...
if you see win 8 start menu carefully you will see after button click there is a 3DRotation animation that rotate the button around Y axis and scale it to big (scale animation). the button come front and full screen then the page load and page element fade in page.
after 1 day search i understand i must use 3d working and i cant do that with 2d animation and transform.
now i create a viewport3D and i place my visual in that (4 buttons (UserControl)) then after click it rotation animation work .I using Viewport2DVisual3D for show my button in 3d viewport3D.
problem is here :
1- How can i resize my element to full screen of window (i scale it but it is not exact full screen and other element still are in back of this big one and if the user resize the window scale fail !)
2- after doing animation how can i remove other menu button (like close and minimize) from window .(i have a grid that has viewport3D and two button close and minimize in it after scale the button they are still there (i must set those 2 button in viewport3D too ? because i dont need 3d effect for them))
3- when you maximize the window 3d element miss the real place how can i do like grid placing in viewport3D.(dont forget i cant put my button in grid because i need animation the visual then if i place them in grid visual will be whole grid , all grid will get animation)
I'm Using wpf in VS2010 and target pc with xp and 7 windows ;
in viewport3d, there are attributes like scalex,scaley and scalez. you can give scaling for each axis, also i thinking , you have to adjus fov , nearplane distance. when scaling.
please refer this link https://social.msdn.microsoft.com/Forums/vstudio/en-US/642253a6-e7a5-4ce2-bc08-e91f2634605b/disable-autoresize-autoscale-in-viewport3d?forum=wpf
Related
I have many buttons in winform. it's look like buttons in calculator.
When I open full screen, buttons stays on top left side (same size they were before) and on the right side there is empty background of form.
How can I make them get bigger and stay centered relatively when I open winform on full screen?
If you have 2 or less buttons per row/column, then you can use anchors.
However, if you have more than 2 buttons per row/column, you'll need to use a TableLayoutPanel (granted you don't have an external controls library like DevExpress or Telerik) which you can then dock/anchor accordingly.
You can dock your controls in the center. Try the following:
1) Select your controls through pressing right cursor of the mouse and hovering over your controls
2) Place your controls in the center
2) Go to 'Properties' panel and find 'Anchor' property
3) Deselect all the anchors (default anchors are top and right)
Try running and resizing your Windows Forms application.
When I add a button and play the game in Unity editor, it remains in its required position. But when I build and run it, the button's position gets misplaced. I want 1366 x 768 screen resolution with all buttons well positioned.
I suggest you to use Canvas Scaler (to control the scale of your game on several devices) and Anchors (to keep the elements in the position where you want to) on your buttons.
http://docs.unity3d.com/es/current/Manual/script-CanvasScaler.html http://docs.unity3d.com/Manual/UIBasicLayout.html
In the scenario where your buttons are normal size in the editor and exporting to your phone makes them smaller, make sure your Canvas has the Canvas Scaler component, and set the UI Scale Mode to "Scale With Screen Size".
I am having trouble making my WPF window resize in a different direction. Currently, when I shoot an event in my application, application resizes down (I make an element visible and then WPF window automatically resizes). I would like that my application would instead resize up, so that the application would not become hidden by a taskbar. How does one do that?
Below is a picture explaining my problem. Picture 1 shows small window. Picture 2 shows the problem, where window resizes beyond the screen. Picture 3 shows what I want to do.
I can surely code this resizing in my code, where I would move the window, but is there not a nice way in WPF?
Changing the Width or Height property of your window will always change the layout of it to the right or bottom.
The Left and Top property of the window determine the X- and Y-Offset of your window relative to the top-left corner of your screen.
To achieve your goal, you have to do 2 steps:
Increase the window Height by the amount of X
Decrease the window Top by the amount of X
This question already exists:
Closed 10 years ago.
Possible Duplicate:
Click and drag image to image grid?
I have a few image boxes in my form and I was wondering how can I would place a grid across the form that have a bunch of lines so the whole grid is a bunch of 64 x 64 squares. I need it so I can select an image and place it onto a specific square using the mouse and be able to go through the whole grid and check for example how many of one specific image is on the grid. To give you a better idea of what I'm doing is that I have a few image boxs which contain different 64 x 64 images. There is another image box that shows the image I clicked on last, which is like a brush because whenever you left click a box in the grid it pastes it into that specific box in the grid. I also need it so I can right click the box and delete the image in the box the mouse is over. Finally I need to be able to read all the images in the box and output it into a file that I can later open. I'm using it to create land in a game, which the program will output the needed texture and and where ground level is for the boxs which make up the whole terrain. What I need to know is what kind of thing should I do to be able to do this? I've been trying the past few hours on how I make the boxs and how to know where the mouse is and stuff and I'm completely stuck. A simple idea would be helpful. I actually don't know what control(s) I should use for this so an idea that doesn't involve any grid controls is still very helpful.
I don't know if it's the best possible idea, but you could use FlowLayoutPanel with WrapContent set to true and FlowDirection = LeftToRight. I dont know about Drag&Drop operation though (never done it with FlowLayoutPanel, buth there are some nice tutorials out there).
You can track your mouse position using mouse events. If you don't want to do that:
You can get absolute position at any time using:
Point currentPos = System.Windows.Forms.Cursor.Position;
Then, to get relative position on your (current) control:
Point relativeLoc = this.PointToClient(currentPos)
... and then, to get control over which your mouse is on FlowLaoutPanel:
Control c = flowLayoutPanel1.GetChildAtPoint(relativeLoc);
I want measuring tool in project that will be same as measure it in Firefox (add-on). How to do this?
To get such a think to work you'll need an application that runs as a tray icon or something like that. Then you open your application and tell him, that you'd like to measure.
Now, you'll go and put a transparent window onto the whole screen(s) and wait for a mouse move event. Within the mouse move event, you'll check the mouse button state. If it is going to be hit you know the starting position and you can draw some kind of user-control at this position and if the user releases the mouse button, you're going to stop the resizing of your user-control.
The user-control itself should be semi-transparent and checking for the resizing and/or paint events, to draw the ruler lines around the border.
Last but not least you can show some kind of tooltip or labelcontrol in relation to the position and size of your user-control and screen bounds to give some status informations.
To get a good starting point about how to get the transparent overlay part done, you can take a look into ObjectListView Overlay.
--EDIT--
One solution could be:
Create a separate transparent windows form
Upon certain key press, for instance Ctrl+Shift+R, show your app with lower transparency level; so that user can see the background.
Draw ruler upon form load
You may allow user to move the ruler window with mouse click.