Questions tagged [bounds]

In user interfaces and graphics, bounds refer to the size and location of a window or view.

In user interfaces and graphics, bounds refers to the size and location of a window or view. In 2D graphics, this is broken down into four parts. Combinations often used include:

  • x-location, y-location, width, and height.
  • x-location, y-location, right, bottom.

Likewise, in 3D graphics, bounds are often broken into 6 components:

  • x, y, z, width, height, depth
769 questions
-1
votes
5 answers

Index was outside the bounds of the array. But the index is in bounds

I ran into an exception "System.IndexOutOfRangeException" on a project and isolated into this example code block here. using System; public class Program { public static void Main() { string testStr = "AB5, BC4, CD8, DC8, DE6, AD5,…
-1
votes
1 answer

Index out of bounds when reading from file

I have a problem with this easy code name=['r9460.txt'] fid=fopen(name,'r'); while ~(feof(fid)), head=fscanf(fid,'%d',11) if ~(isempty(head)), m=head(4) d=head(3) y=head(2) end end fclose(fid) The txt is 5 1994 …
-1
votes
3 answers

Index was outside the bounds of the array in C# Can any let me Know where i made MISTAKE

In the following code i have errors as Index was outside the bounds of the array. Even this code done copied cells into column correctly .. does any one help me on this string[] array = { "F3", "J3", "N3", "R3", "V3", "Z3", "AD3", "AH3", "AL3",…
inshaf
  • 1
  • 1
-2
votes
1 answer

How do I check an array's bounds and make sure the code does not error in the game "Go" that I am making in Java

protected void pressedOnSpace(int row, int col) { if (board[row][col] < board[0][0]) { canvas.errors = false; } if (board[row][col] == GoFrame.WHITE) { board[row][col] = GoFrame.BLACK; } else if (board[row][col]…
-2
votes
2 answers

Array out of bounds in C

I want to know how I can catch IndexOutofbounds in C. I do not want my program to exit abnormally, I want to print a message for the user that clarify the error how I can check for this case char a[50]; fgets(a,200,stdin); I need to exit the…
-2
votes
1 answer

Correct way of extending map boundaries without using bounds.extend(point)

I am using map bounds to display markers that fall within the current viewport. Upon zooming or panning the bounds are recalculated and the markers that fall within these bounds are redrawn, effectively hiding any not contained within the…
Maeglin77
  • 173
  • 1
  • 14
-2
votes
1 answer

C++ vector bounds checking

I have a 6D vector and I need to check neighborhood of each element (2 elements in each direction). Of course when I am on boundary of the vector, check leads in the Segmentation fault. All I can do is having switch with ton of cases. Is there any…
-2
votes
1 answer

How does below method of array initialization differ in context to array bounds checking?

Why does int arr[2]={10,20,30,40,50} leads to error? Why can't this initialization escape error by Array Bound Checking? int arr[2] ; arr[0]=10, arr[1]=20, arr[3]=30, arr[4]=40; Doesn't cause error in context to C language by array bound checking?
-2
votes
2 answers

Why does JCompnent.getBounds() always return 0 values?

When I try to get the bounds of a JPanel it always returns ( I use this.getBounds() in the constructor of the JPanel class): java.awt.Rectangle[x=0,y=0,width=0,height=0] At what point in the rendering of a Swing component does this actually get…
cj5
  • 785
  • 3
  • 12
  • 34
-2
votes
1 answer

What is the bound or T(n) of this algorithm?

def unknownsort(A[],x,y): if x ==y+1: if A[x]>A[y]: switch A[x] and A[y] elif y > x+1: z = (y-x+1)/3 unkownsort(A[],x,y-z) unkownsort(A[],x+z,y) unkownsort(A[],x,y-z) Is there a name for this equation? For T(n) what is…
user3175173
  • 103
  • 2
  • 13
-2
votes
1 answer

Only Getting 0s for an output on Array Assignment

I have an assignment and I need to write the code for this problem. Write a program that reads numbers from the keyboard into an array of type int[] You may assume there will be 50 or fewer entries. Your program allows any amount of numbers to be…
Conrad
  • 1
  • 2
-2
votes
1 answer

How to draw bounds equal to the width and height of screen?

I've been searching for hours trying to find out how to make bounds so the bitmap should not go out of the screen when I'm moving it with my buttons up,down,left,right. It should stay in the screen.
Dritan Berna
  • 171
  • 1
  • 3
  • 12
-2
votes
1 answer

"variable".Bounds.IntersectsWith

How do I make the do while loop in my code work with z being a variable? Function make(ByVal z As Object) z.Location = zloc z.Hide() zloc = New Point(RandomNumber(playspace.Width), RandomNumber(playspace.Height)) If zloc.Y > 595…
-3
votes
1 answer

Matlab indexing and bounds

I get the following error when I try to run this code "Attempted to access id(90); index out of bounds because numel(id)=89.Error in Untitled66 (line 26) person = find(id(fileNum)==ids);" Can someone help me spot the error? % File Names reading and…
popeye
  • 47
  • 1
  • 1
  • 10
-3
votes
1 answer

How iOS's coordinate system works?

nice to meet you. I am studying "Coordinate System" of UIView of iOS. Frame is easy to understand, but Bounds isn't. For example, Frame works as expected when you change origin. Bounds does not change its position even if we change origin. import…
Byeongin Yoon
  • 3,233
  • 6
  • 26
  • 44
1 2 3
51
52