Search Results

Search found 1517 results on 61 pages for 'aspect ratio'.

Page 1/61 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Keeping Aspect Screen Ration While Stays in Center

    - by David Dimalanta
    I sqw and I tried this suggestion on PISTACHIO BRAINSTORMIN* on how to make a good and adaptive screen ration. For every different screen size, let's say I put the perfect circle as a Texture in LibGDX and played it on screen. Here's the blueberry image example and it's perfectly rounded: When I played it on the Google Nexus 7, the circle turn into a slightly oblonng shape, resembling as it was being flatten a bit. Please observe this snapshot below and you can see the blueberry is almost but slightly not perfectly rounded: Now, when I tried the suggested code for aspect ratio, the perfect circle retained but another problem is occured. The problem is that I expecting for a view on center but instead it's been moved to the right offset leaving with a half black screen. This would be look like this: Here is my code using the suggested screen aspect ratio code: Class' Field // Ingredients Needed for Screen Aspect Ratio private static final int VIRTUAL_WIDTH = 720; private static final int VIRTUAL_HEIGHT = 1280; private static final float ASPECT_RATIO = ((float) VIRTUAL_WIDTH)/((float) VIRTUAL_HEIGHT); private Camera Mother_Camera; private Rectangle Viewport; render() // Camera updating... Mother_Camera.update(); Mother_Camera.apply(Gdx.gl10); // Reseting viewport... Gdx.gl.glViewport((int) Viewport.x, (int) Viewport.y, (int) Viewport.width, (int) Viewport.height); // Clear previous frame. Gdx.gl.glClearColor(0, 0, 0, 1); Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT); show() Mother_Camera = new OrthographicCamera(VIRTUAL_WIDTH, VIRTUAL_HEIGHT); Was this code useful for screen aspect ratio-proportion fixing or it is statically dependent on actual device's width and height? *see http://blog.acamara.es/2012/02/05/keep-screen-aspect-ratio-with-different-resolutions-using-libgdx/#comment-317

    Read the article

  • Keeping Aspect Screen Ratio While Stays in Center

    - by David Dimalanta
    I sqw and I tried this suggestion on PISTACHIO BRAINSTORMIN* on how to make a good and adaptive screen ration. For every different screen size, let's say I put the perfect circle as a Texture in LibGDX and played it on screen. Here's the blueberry image example and it's perfectly rounded: When I played it on the Google Nexus 7, the circle turn into a slightly oblonng shape, resembling as it was being flatten a bit. Please observe this snapshot below and you can see the blueberry is almost but slightly not perfectly rounded: Now, when I tried the suggested code for aspect ratio, the perfect circle retained but another problem is occured. The problem is that I expecting for a view on center but instead it's been moved to the right offset leaving with a half black screen. This would be look like this: Here is my code using the suggested screen aspect ratio code: Class' Field // Ingredients Needed for Screen Aspect Ratio private static final int VIRTUAL_WIDTH = 720; private static final int VIRTUAL_HEIGHT = 1280; private static final float ASPECT_RATIO = ((float) VIRTUAL_WIDTH)/((float) VIRTUAL_HEIGHT); private Camera Mother_Camera; private Rectangle Viewport; render() // Camera updating... Mother_Camera.update(); Mother_Camera.apply(Gdx.gl10); // Reseting viewport... Gdx.gl.glViewport((int) Viewport.x, (int) Viewport.y, (int) Viewport.width, (int) Viewport.height); // Clear previous frame. Gdx.gl.glClearColor(0, 0, 0, 1); Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT); show() Mother_Camera = new OrthographicCamera(VIRTUAL_WIDTH, VIRTUAL_HEIGHT); Was this code useful for screen aspect ratio-proportion fixing or it is statically dependent on actual device's width and height? *see http://blog.acamara.es/2012/02/05/keep-screen-aspect-ratio-with-different-resolutions-using-libgdx/#comment-317

    Read the article

  • Handling window resize with arbitrary aspect ratios

    - by DormoTheNord
    I'm currently making a 2D game using SFML. I want the aspect ratio to be maintained when the user resizes the window. I also want the game to work with any arbitrary aspect ratio (like any media player would). Here is the code I have so far: void os::GameEngine::setCameraViewport() { sf::FloatRect tempViewport; float viewAspectRatio = (float)aspectRatio.x / aspectRatio.y; float screenAspectRatio = (float)gameWindow.getSize().x / gameWindow.getSize().y; if (viewAspectRatio > screenAspectRatio) { // Viewport is wider than screen, fit on X } else if (viewAspectRatio < screenAspectRatio) { // Screen is wider than viewport, fit on Y } else // window aspect ratio matches view aspect ratio { tempViewport.height = 1; tempViewport.width = 1; tempViewport.left = 0; tempViewport.top = 0; } viewport = tempViewport; camera.setViewport(viewport); gameWindow.setView(camera); } The problem is I'm having trouble with the logic to determine the properties of the viewport.

    Read the article

  • the unity aspect ratio script looks good in computer but not in android phones

    - by Pooya Fayyaz
    I'm developing a game for android devices.and i have a script that solve the ratio problem but i have a problem in this code.and i dont know why.it looks perfect in computer even resize the game screen but in mobile phones have a problem.my game runs in landscape mode.this is the script : using UnityEngine; using System.Collections; using System.Collections.Generic; public class reso : MonoBehaviour { void Update() { // set the desired aspect ratio (the values in this example are // hard-coded for 16:9, but you could make them into public // variables instead so you can set them at design time) float targetaspect = 16.0f / 9.0f; // determine the game window's current aspect ratio float windowaspect = (float)Screen.width / (float)Screen.height; // current viewport height should be scaled by this amount float scaleheight = windowaspect / targetaspect; // obtain camera component so we can modify its viewport Camera camera = GetComponent<Camera>(); // if scaled height is less than current height, add letterbox if (scaleheight < 1.0f && Screen.width <= 490 ) { Rect rect = camera.rect; rect.width = 1.0f; rect.height = scaleheight; rect.x = 0; rect.y = (1.0f - scaleheight) / 2.0f; camera.rect = rect; } else // add pillarbox { float scalewidth = 1.0f / scaleheight; Rect rect = camera.rect; rect.width = scalewidth; rect.height = 1.0f; rect.x = (1.0f - scalewidth) / 2.0f; rect.y = 0; camera.rect = rect; } } } i figure that my problem occur in this part of the script: if (scaleheight < 1.0f) { Rect rect = camera.rect; rect.width = 1.0f; rect.height = scaleheight; rect.x = 0; rect.y = (1.0f - scaleheight) / 2.0f; camera.rect = rect; } and its look like this in my mobile phone in portrait: and in landscape mode:

    Read the article

  • PHP Aspect Oriented Design

    - by Devin Dixon
    This is a continuation of this Code Review question. What was taken away from that post, and other aspect oriented design is it is hard to debug. To counter that, I implemented the ability to turn tracing of the design patterns on. Turning trace on works like: //This can be added anywhere in the code Run::setAdapterTrace(true); Run::setFilterTrace(true); Run::setObserverTrace(true); //Execute the functon echo Run::goForARun(8); In the actual log with the trace turned on, it outputs like so: adapter 2012-02-12 21:46:19 {"type":"closure","object":"static","call_class":"\/public_html\/examples\/design\/ClosureDesigns.php","class":"Run","method":"goForARun","call_method":"goForARun","trace":"Run::goForARun","start_line":68,"end_line":70} filter 2012-02-12 22:05:15 {"type":"closure","event":"return","object":"static","class":"run_filter","method":"\/home\/prodigyview\/public_html\/examples\/design\/ClosureDesigns.php","trace":"Run::goForARun","start_line":51,"end_line":58} observer 2012-02-12 22:05:15 {"type":"closure","object":"static","class":"run_observer","method":"\/home\/prodigyview\/public_html\/public\/examples\/design\/ClosureDesigns.php","trace":"Run::goForARun","start_line":61,"end_line":63} When the information is broken down, the data translates to: Called by an adapter or filter or observer The function called was a closure The location of the closure Class:method the adapter was implemented on The Trace of where the method was called from Start Line and End Line The code has been proven to work in production environments and features various examples of to implement, so the proof of concept is there. It is not DI and accomplishes things that DI cannot. I wouldn't call the code boilerplate but I would call it bloated. In summary, the weaknesses are bloated code and a learning curve in exchange for aspect oriented functionality. Beyond the normal fear of something new and different, what are other weakness in this implementation of aspect oriented design, if any? PS: More examples of AOP here: https://github.com/ProdigyView/ProdigyView/tree/master/examples/design

    Read the article

  • Is aspect oriented programming a misnomer?

    - by glenviewjeff
    From everything I have learned about "Aspect Oriented Programming" or "Aspect Oriented Software Development," labeling it as a programming paradigm or methodology appears to be inaccurate. From what I can tell it is not a fundamental technique for programming. To nail down what is meant by "paradigm" and "methodology," please refer to the following definitions from the American Heritage Dictionary. Compare how well or poorly "Object-Oriented Programming" applies to each vs. how well AOP fits. Paradigm: A set of assumptions, concepts, values, and practices that constitutes a way of viewing reality for the community that shares them, especially in an intellectual discipline. Methodology: A body of practices, procedures, and rules used by those who work in a discipline or engage in an inquiry; a set of working methods. "Evidence-based medicine" satisfies the definition of paradigm, but "hysterectomy-based medicine" would be a misnomer because the problem space is too narrow. I am getting the impression that AOP may be misnamed because based on the "oriented-programming" suffix, AOP is alleging to be both a paradigm and a methodology in the same way "Object-Oriented Programming" is. Both of these terms (paradigm and methodology) indicate a fundamental technique, where what I understand about aspects is a technology for solving a narrow problem scope, maybe comparable in magnitude to the static variable feature of Java. If it's true that aspects solve a narrow set of problems, and AOP isn't a misnomer, then why shouldn't all programming techniques be given the "oriented-programming" suffix, such as "inheritance-oriented programming," "dependency-oriented programming," or "scope-oriented programming?"

    Read the article

  • The Underlying Value of Aspect-Oriented Programming

    - by Brian
    Hello, I recently got into PostSharp, an AOP tool for weaving in code. I've been finding a lot of resistance with other developers over giving up writing code to perform the tasks the weaving was meant to simplify. For instance, I'm finding logging or error-handling code where I have postsharp already doing that. I can understand why its happening, since its hard to remember everything that weaving was setup to do (I'm applying a global attribute definition). With that said, factoring in levels of experience, etc, is AOP beneficial to a project? What is your opinion? Thanks.

    Read the article

  • When to use Aspect Oriented Architecture (AOA/AOD)

    When is it appropriate to use aspect oriented architecture? I think the only honest answer to this question is that it depends on the context for which the question is being asked. There really are no hard and fast rules regarding the selection of an architectural model(s) for a project because each model provides good and bad benefits. Every system is built with a unique requirements and constraints. This context will dictate when to use one type of architecture over another or in conjunction with others. To me aspect oriented architecture models should be a sub-phase in the architectural modeling and design process especially when creating enterprise level models. Personally, I like to use this approach to create a base architectural model that is defined by non-functional requirements and system quality attributes.   This general model can then be used as a starting point for additional models because it is targets all of the business key quality attributes required by the system.Aspect oriented architecture is a method for modeling non-functional requirements and quality attributes of a system known as aspects. These models do not deal directly with specific functionality. They do categorize functionality of the system. This approach allows a system to be created with a strong emphasis on separating system concerns into individual components. These cross cutting components enables a systems to create with compartmentalization in regards to non-functional requirements or quality attributes.  This allows for the reduction in code because an each component maintains an aspect of a system that can be called by other aspects. This approach also allows for a much cleaner and smaller code base during the implementation and support of a system. Additionally, enabling developers to develop systems based on aspect-oriented design projects will be completed faster and will be more reliable because existing components can be shared across a system; thus, the time needed to create and test the functionality is reduced.   Example of an effective use of Aspect Oriented ArchitectureIn my experiences, aspect oriented architecture can be very effective with large or more complex systems. Typically, these types of systems have a large number of concerns so the act of defining them is very beneficial for reducing the system’s complexity because components can be developed to address each concern while exposing functionality to the other system components. The benefits to using the aspect oriented approach as the starting point for a system is that it promotes communication between IT and the business due to the fact that the aspect oriented models are quality attributes focused so not much technical understanding is needed to understand the model.An example of this can be in developing a new intranet website. Common Intranet Concerns: Error Handling Security Logging Notifications Database connectivity Example of a not as effective use of Aspect Oriented ArchitectureAgain in my experiences, aspect oriented architecture is not as effective with small or less complex systems in comparison.  There is no need to model concerns for a system that has a limited amount of them because the added overhead would not be justified for the actual benefits of creating the aspect oriented architecture model.  Furthermore, these types of projects typically have a reduced time schedule and a limited budget.  The creation of the Aspect oriented models would increase the overhead of a project and thus increase the time needed to implement the system. An example of this is seen by creating a small application to poll a network share for new files and then FTP them to a new location.  The two primary concerns for this project is to monitor a network drive and FTP files to a new location.  There is no need to create an aspect model for this system because there will never be a need to share functionality amongst either of these concerns.  To add to my point, this system is so small that it could be created with just a few classes so the added layer of componentizing the concerns would be complete overkill for this situation. References:Brichau, Johan; D'Hondt, Theo. (2006) Aspect-Oriented Software Development (AOSD) - An Introduction. Retreived from: http://www.info.ucl.ac.be/~jbrichau/courses/introductionToAOSD.pdf

    Read the article

  • Fine control over zoom and aspect ratio in VLC player

    - by ashh
    In VLC Player (v1.01), how do I zoom video and control aspect ratio with fine control, as is possible with Media Player Classic Home Cinema (MPCHC)? The standard zoom appears to only support double, normal, quarter size etc, not useful to me at all. An example: I play an older music video file that is in 4:3 aspect ratio. In MPCHC I can use the number pad to zoom in small increments until I have removed the left and right letterbox bars and the video fills the whole screen. I can also stretch and move the video in small increments until I am happy with the aspect ratio and position. I could continue using MPCHC, but I have two displays and really like VLC feature enabling full-screen video on the main screen and the VLC interface (menus etc) on the second. I have not found a way to do this on MPCHC, if anyone knows I'd also be interested to hear.

    Read the article

  • Best software to convert video to a different aspect ratio for various screensizes

    - by facepalmd
    I sometimes get .mp4 and other video formats whose aspect ratio is clearly off What apps do you use to reconvert such videos to an aspect ratio better suited to to fit either a regular desktop or LCD screen size? Hopefully with little or no loss of audio/video quality Any instructions on best settings to use would be very welcome. I have so far mostly used vlc which came off with less-than-ideal results. Thanks for any help you can offer.

    Read the article

  • Aspect Ratio on Nero 9 for burning DVD

    - by user27720
    I am currently attempting to burn a screen capture file to DVD. I will admit that I know very little about the process, the terminology, and am at a loss of how to find this information. I am using Nero 9 and am very displeased that the manuals available to me online explain very little. My current problem is that when I burn to DVD, my beautiful screen capture ends up being cropped. Through endless amounts of googling I am under the impression that this is due to aspect ratio. However, as windows will not tell me the resolution size for me to determine the correct aspect ratio I do not know how to proceed. Is there a way using Nero 9 for me to be able to burn my screen capture to DVD? Any advice or suggestions are appreciated.

    Read the article

  • How to adjust Aspect Ratio in Windows Media Center

    - by Svish
    Is there any way of adjusting the aspect ratio of movies I view in Windows Media Center on Windows 7 RTM x64? Any hidden features? Any brilliant light weight plugins? Using Shark007 Codecs, and otherwise just default Media Center and Media Player. I know I could reprocess the videos, but that would probably ruin the already bad quality. I also know I could use VLC media player, but I really would like to find a solution that works in Media Center, since VLC media player isn't especially Remote Control and media collection friendly... Update: By the way, I know I can Ctrl+Drag an edge of the media center in window mode and change the aspect ratio of the player, but that doesn't do anything to the video.

    Read the article

  • Get aspect ratio of a monitor

    - by Alexander Stalt
    I want to get aspect ratio of a monitor as two digits : width and height. For example 4 and 3, 5 and 4, 16 and 9. I wrote some code for that task. Maybe it is any easier way to do that ? For example, some library function =\ /// <summary> /// Aspect ratio. /// </summary> public struct AspectRatio { int _height; /// <summary> /// Height. /// </summary> public int Height { get { return _height; } } int _width; /// <summary> /// Width. /// </summary> public int Width { get { return _width; } } /// <summary> /// Ctor. /// </summary> /// <param name="height">Height of aspect ratio.</param> /// <param name="width">Width of aspect ratio.</param> public AspectRatio(int height, int width) { _height = height; _width = width; } } public sealed class Aux { /// <summary> /// Get aspect ratio. /// </summary> /// <returns>Aspect ratio.</returns> public static AspectRatio GetAspectRatio() { int deskHeight = Screen.PrimaryScreen.Bounds.Height; int deskWidth = Screen.PrimaryScreen.Bounds.Width; int gcd = GCD(deskWidth, deskHeight); return new AspectRatio(deskHeight / gcd, deskWidth / gcd); } /// <summary> /// Greatest Common Denominator (GCD). Euclidean algorithm. /// </summary> /// <param name="a">Width.</param> /// <param name="b">Height.</param> /// <returns>GCD.</returns> static int GCD(int a, int b) { return b == 0 ? a : GCD(b, a % b); } }

    Read the article

  • Display aspect ratio problem on netbooks?

    - by Jian Lin
    Last night in a computer store with the midnight sale of Windows 7, I see many netbooks, all are 1024 x 600 resolution. Then when the CPU meter and the Clock gadget were added, the CPU meter looked spherical, but the clock (the second clock -- the silver one) looked somewhat oval. Later on I went to all the desktops and both the CPU meter and the clock were spherical. So do the netbook have this "aspect ratio" problem? It is not a big deal but it'd be nice to know if I get a netbook and know that it is common on the netbook. (and aware that the picture and photos will be slightly distorted). Update: All the netbooks were at 1024 x 600, which was their "native" resolution. Every single one of them showed an oval shaped clock. None of the desktop had that issue.

    Read the article

  • Automatically change aspect ratio of WMC videos

    - by NeverwaY
    is there a way to automatically change the aspect ratio flag of a video so that it displays in 16:9 in all video players WITHOUT reencode? Quality loss is not a concern. I just need a quick and efficient way to convert several video files to 16:9 as quickly as possible. For instance, older tv show series. I use a plasma tv for my media center, and do not want black bars burnt into my screen when people that dont understand how to use the zoom function in WMC7 watch tv all day. thanks.

    Read the article

  • Why do camera's aspect ratio look good on computer but not on Android devices?

    - by Pooya Fayyaz
    I'm developing a game for Android devices and I have a script that solves the aspect-ratio problem for computer screens but not for my intended target platform. It looks perfect on computer, even when re-sizing the game screen, but not when running my game in landscape mode on mobile phones. This is my script using UnityEngine; using System.Collections; using System.Collections.Generic; public class reso : MonoBehaviour { void Update() { // set the desired aspect ratio (the values in this example are // hard-coded for 16:9, but you could make them into public // variables instead so you can set them at design time) float targetaspect = 16.0f / 9.0f; // determine the game window's current aspect ratio float windowaspect = (float)Screen.width / (float)Screen.height; // current viewport height should be scaled by this amount float scaleheight = windowaspect / targetaspect; // obtain camera component so we can modify its viewport Camera camera = GetComponent<Camera>(); // if scaled height is less than current height, add letterbox if (scaleheight < 1.0f && Screen.width <= 490 ) { Rect rect = camera.rect; rect.width = 1.0f; rect.height = scaleheight; rect.x = 0; rect.y = (1.0f - scaleheight) / 2.0f; camera.rect = rect; } else // add pillarbox { float scalewidth = 1.0f / scaleheight; Rect rect = camera.rect; rect.width = scalewidth; rect.height = 1.0f; rect.x = (1.0f - scalewidth) / 2.0f; rect.y = 0; camera.rect = rect; } } } I figured that my problem occurs in this part of the script: if (scaleheight < 1.0f) { Rect rect = camera.rect; rect.width = 1.0f; rect.height = scaleheight; rect.x = 0; rect.y = (1.0f - scaleheight) / 2.0f; camera.rect = rect; } Its look like this on my mobile phone (portrait): and on landscape mode:

    Read the article

  • Is it a good idea to make a game for one aspect ratio and arbitrary screen resolution?

    - by Mimars
    After several very small games I have decided to make something more standalone (2D) and playable. However, I have met the problem of every game that is going to be played in more screen resolutions. Basically, after some research I see that there are several solutions. This seems to be the simplest one: Let's say I define a constant aspect ratio for the game (16:9) and the whole game will be created for a resolution 1680 x 1050. The game will be rendered in this resolution and then I will be able to scale the render to match the player's display resolution. Therefore the game might be playable on almost any resolution, while it would keep the aspect ratio. So, if the game was run on 4:3 display, the top and the bottom of the display would be filled with black color. It seems easy, but my question is - Is this a good approach for a simple game? The game will be simple, but I want to maintain high quality.

    Read the article

  • How to "smart resize" a displayed image to original aspect ratio

    - by Paul Sasik
    I have an application in which end-users can size and position images in a designer. Since the spec calls for the image to be "stretched" to the containing control, the end user can end up with an awkwardly stretched image. To help the user with image sizing I am thinking of implementing a smart resizer function which would allow the the user to easily fix the aspect ratio of the picture so that it no longer appears stretched. The quick way to solve this is to actually provide two options: 1) scale from width 2) scale from height. The user chooses the method and the algorithm adjusts the size of the picture by using the original aspect ratio. For example: A picture is displayed as 200x200 on the designer but the original image is 1024x768 pixels. The user chooses "Smart Size from width" and the new size becomes ~200x150 since the original aspect ratio is ~1.333 That's OK, but how could I make the algorithm smarter and not bother the user by asking which dimension the recalculation should be based on?

    Read the article

  • Resizing image with Python with locked aspect ratio

    - by David Vinklar
    How should I resize an image with Python script so that it would automatically adjust the Height ratio to the Width used? I'm using the following code: def Do(Environment): # Resize App.Do( Environment, 'Resize', { 'AspectRatio': 1.33333, 'CurrentDimensionUnits': App.Constants.UnitsOfMeasure.Pixels, 'CurrentResolutionUnits': App.Constants.ResolutionUnits.PixelsPerIn, 'Height': 1440, 'MaintainAspectRatio': True, 'Resample': True, 'ResampleType': App.Constants.ResampleType.SmartSize, 'ResizeAllLayers': True, 'Resolution': 72, 'Width': 1920, }) Using this code works perfectly if the aspect ratio of an image is the same as the one defined in the code - i.e. 1.33333. But how should I make it work with images that do not have this ratio? For me, what is important is that the new Width is 1920; Height has to be able to adjust automatically. Any ideas which part of my code should be altered and how?

    Read the article

  • Is Ruby on Rails' Active Record an example of Aspect-Oriented Programming?

    - by B Seven
    From Clean Code, about Cross-Cutting Concerns: Note that concerns like persistence tend to cut across the natural object boundaries of a domain. You want to persist all your objects using generally the same strategy, for example, using a particular DBMS... Is Active Record an example of aspect-oriented programming? In AOP, modular constructs called aspects specify which points in the system should have their behavior modified in some consistent way to support a particular concern. This specification is done using a succinct declarative or programmatic mechanism. If Active Record is an example of AOP, what is the "aspect"? Is it the class declaration that inherits from Active Record? class Foo < ActiveRecord::Base

    Read the article

  • Scaling ratio of two different resolutions

    - by BBDeveloper
    I have two different resolutions, the original one is 567x756 (wXh), the one which I want to display is 768x1024 (wXh). How to find out the scaling ratio for these two resolutions? For example if the font size used in 567x756 resolution is 7 pts then whats the values I should multiply with the font size (7 pts) to display the text in 768x1024 resolution. Can anyone help me in this issue? Its little urgent. Thanks in advance.

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >