Search Results

Search found 720 results on 29 pages for 'dimension'.

Page 17/29 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • ipad video format

    - by Mike
    When you use iTunes to sync your videos with the iPhone the videos are always saved with no more than 640 pixels wide, if I am not wrong. What about the iPad? What is the size of videos iTunes syncs with iPad? 1024x768? and what if the video has a dimension below 1024x768? Will it scale up? or will it keep the video at low res and scale when you play? The question is because I am using the MPMoviePlayerController and I need to know what resolutions to expect, so I can adjust the interface. thanks.

    Read the article

  • How to handle Booleans/CheckBoxes in ASP.NET MVC 2 with DataAnnotations?

    - by asp_net
    I've got a view model like this: public class SignUpViewModel { [Required(ErrorMessage = "Bitte lesen und akzeptieren Sie die AGB.")] [DisplayName("Ich habe die AGB gelesen und akzeptiere diese.")] public bool AgreesWithTerms { get; set; } } The view markup code: <%= Html.CheckBoxFor(m => m.AgreesWithTerms) %> <%= Html.LabelFor(m => m.AgreesWithTerms)%> The result: No validation is executed. That's okay so far because bool is a value type and never null. But even if I make AgreesWithTerms nullable it won't work because the compiler shouts "Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressions." So, what's the correct way to handle this?

    Read the article

  • JScrollPane and JList auto scroll

    - by dododedodonl
    Hi All, I've got the next code: listModel = new DefaultListModel(); listModel.addElement(dateFormat.format(new Date()) + ": Msg1"); messageList = new JList(listModel); messageList.setLayoutOrientation(JList.VERTICAL); messageScrollList = new JScrollPane(messageList); messageScrollList.setPreferredSize(new Dimension(500, 200)); messageScrollList.getVerticalScrollBar().addAdjustmentListener(new AdjustmentListener() { public void adjustmentValueChanged(AdjustmentEvent e) { e.getAdjustable().setValue(e.getAdjustable().getMaximum()); } }); It auto scrolls down. But, if I try to scroll back up to re-read a message, it forces a scroll down. How can I fix this?

    Read the article

  • iPhone SDK: How to centre content in a UIScrollView during setZoomScale?

    - by Russell Quinn
    I'm using a UIScrollView to show photos. If they are zoomed out so they are smaller than the scroll view in one dimension then the content is centred using contentInset and contentOffset. This all works fine for scrolling and manual zooming. However, if I use setZoomScale (with animated YES) then when zooming out the scroll view sets the top left edge to 0,0 during the animation and then snaps it back afterwards. It seems like the zoom animation ignores the contentInset and contentOffset settings. Does anyone have any idea how to overcome this problem? Thanks, Russell.

    Read the article

  • ipad vide format

    - by Mike
    When you use iTunes to sync your videos with the iPhone the videos are always saved with no more than 640 pixels wide, if I am not wrong. What about the iPad? What is the size of videos iTunes syncs with iPad? 1024x768? and what if the video has a dimension below 1024x768? Will it scale up? or will it keep the video at low res and scale when you play? thanks.

    Read the article

  • What are the video formats supported by MPMoviePlayerController on the iPad?

    - by Mike
    When you use iTunes to sync your videos with the iPhone the videos are always saved with no more than 640 pixels wide, if I am not wrong. What about the iPad? What is the size of videos iTunes syncs with iPad? 1024x768? and what if the video has a dimension below 1024x768? Will it scale up? or will it keep the video at low res and scale when you play? The question is because I am using the MPMoviePlayerController and I need to know what resolutions to expect, so I can adjust the interface. thanks.

    Read the article

  • ipad video format [closed]

    - by Mike
    When you use iTunes to sync your videos with the iPhone the videos are always saved with no more than 640 pixels wide, if I am not wrong. What about the iPad? What is the size of videos iTunes syncs with iPad? 1024x768? and what if the video has a dimension below 1024x768? Will it scale up? or will it keep the video at low res and scale when you play? thanks.

    Read the article

  • Java - sorted stack

    - by msr
    Hello, I need a sorted stack. I mean, the element removed from the stack must be the one with great priority. Stack dimension varies a lot (becomes bigger very fast). I need also to search elements in that stack. Does Java give some good implementation for this? What class or algorithm do you suggest for this? I'm using a PriorityQueue right now which I consider reasonable except for searching, so Im wondering if I can use something better. Thanks in advance!

    Read the article

  • Multidimensional arrays in VB.NET 2010

    - by matt_t
    Is there any way to create a multidinensional array that contains arrays of different lengths (similar to nesting arrays of different lengths in python). Because if I were to declare a variable Dim accounts(2,2) As Integer all 1D arrays at each dimension have the same length. Is there any way to create an array so that this is not the case? e.g The above code would create an array like this: [[0,0],[0,0]] but would it be possible to create this: [[0,0],[0,0,0]] Apologies for the poor explanation but I cannot think of any better ways to explain.

    Read the article

  • Make overflow hidden when shrinking div

    - by johnnietheblack
    I have a div with an image in it, and the image is too large for the div. I have solved the overflow problem with the obvious CSS overflow:hidden trick. But, the problem is that when the div's parent resizes (shrinks), the div holding the image won't shrink because of the image in it. Is there a way to have a resizable div with an image in it (almost like a background image) that overflows? MY DIV STRUCTURE: <div id="parent"> <div id="image_holder"> <!-- this image will inevitably be larger than its parent div --> <img src="too_big_for_div.jpg" /> </div> </div> MY CSS: #parent { width:100%;} #image_holder { width:100%; overflow:hidden;} The #image_holder div will not resize to a smaller dimension now. Any ideas?

    Read the article

  • Wordpress plugin for enhanced WYSIWYG image resizing?

    - by Gnee
    Really, really trying to find a plugin that gives adds functionality to the image-resize functions in Wordpress's WYSIWYG editor. Something where the use of 'Gallery' is not mandatory – just an upload straight from the post editor. In a post, when an image is linked to from another site, there are less options – unlike when an image is uploaded. • You can resize, but it's 100%, 110%, 120%, 130% ....Instead of thumbnail, large, medium, etc, when you upload. •These dimension rarely match the dimensions needed. I know you can type in the W x H in the advanced tab, but my quest to find a better solution is really for the clients using the site. If anyone knows a solution / plugin / modification for this, I'd love to hear it!!

    Read the article

  • can't get true height/width of object in chrome

    - by Cinaird
    I have a question, if i set a image height in css and try to get height/width i get different results in different browsers. Is there a way to get the same dimension in all browsers? You can find a live example here and the concept is like this: CSS: img{ height:100px; } Script: $(document).ready(function(){ $("#text").append($("#img_0").attr("height")); $("#text").append($("#img_0").attr("width")); }); Output Firefox: img height: 100 img width: 150 Output Chrome: img height: 100 img width: 0 Output Chrome: img height: 100 img width: 93? i have tried this from StackOverflow: stackoverflow.com/questions/1873419/jquery-get-height-width but still get the same result Any one know a good solution?

    Read the article

  • resize image in asp.net

    - by alina
    I have this code to resize an image but the image doesn't look so good: public Bitmap ProportionallyResizeBitmap(Bitmap src, int maxWidth, int maxHeight) { // original dimensions int w = src.Width; int h = src.Height; // Longest and shortest dimension int longestDimension = (w > h) ? w : h; int shortestDimension = (w < h) ? w : h; // propotionality float factor = ((float)longestDimension) / shortestDimension; // default width is greater than height double newWidth = maxWidth; double newHeight = maxWidth / factor; // if height greater than width recalculate if (w < h) { newWidth = maxHeight / factor; newHeight = maxHeight; } // Create new Bitmap at new dimensions Bitmap result = new Bitmap((int)newWidth, (int)newHeight); using (Graphics g = Graphics.FromImage((System.Drawing.Image)result)) g.DrawImage(src, 0, 0, (int)newWidth, (int)newHeight); return result; }

    Read the article

  • WPF Border Thickness increase direction

    - by morsanu
    Hey. Another WPF question. In my XAML code I have a border: <Border x:Name="myBorder" Background="AliceBlue" Width="200" Height="200" BorderThickness="10" BorderBrush="Black"> </Border> and somewhere in code I increase the BorderThickness double thickness = myBorder.BorderThickness.Bottom + 2; myBorder.BorderThickness = new Thickness(thickness); and the result is that the border's weight increases but not outside the 200x200 width-height, but inner, decreasing the dimension. Is there a way to do the opposite?

    Read the article

  • Question on multi-probe Local Sensitive Hashing

    - by Yijinsei
    Hey guys sorry to be asking this kind noob question, but because I really need some guidance on how to use Multi probe LSH pretty urgently, so I did not do much research myself. I realize there is a lib call LSHKIT available that implemented that algorithm, but I have trouble trying to figure out how to use it. Right now, I have a few thousand feature vector 296 dimension, each representing an image. The vector is used to query an user input image, to retrieve the most similar image. The method I used to derive the distance between vector is euclidean distance. I know this might be a rather noob question, but do you guys have knowledge on how should i implement multi probe LSH? I am really very grateful to any answer or response.

    Read the article

  • How to keep the highlight border of a JComponent, when custom border is set

    - by Frederik Wordenskjold
    I have a JTextField, where I've set some custom properties: nameField.setPreferredSize(new Dimension(275,40)); nameField.setBackground(bgColor); nameField.setForeground(txtColor); nameField.setFont(new Font("HelveticaNeue",Font.PLAIN,22)); nameField.setBorder(BorderFactory.createLineBorder(Color.WHITE, 2)); When the component has focus, there is no highlight shown around the field. On a Mac, it is usually a blue glowing rectangle, indicating that this component has focus. If I comment out the nameField.setBorder(...), the highlight reappears. How do I keep the highlight, but also my custom border!? Basically, I just want the highlight-border to show when the component has focus, and no border when the component is unfocused.

    Read the article

  • Filter elements in PropertyGrid

    - by serhio
    In System.Windows.Forms there are a PropertyGrid that displays properties of an attached object. Let's say MyTextBox : TextBox. Now, I would like to display on it some MyTextBox properties, say only Size, Location and my custom property Date. More that than, I would like to be able to change the real property names, say "Dimension", "Location" and "Starting Date". I saw two projects on this subject : first and second, but first does not work well(for browsable properties), and the second seems to add an event for each property changes, this is not acceptable.

    Read the article

  • Resize a WPF window, but maintain proportions?

    - by rathkopf
    I have a user resizable WPF Window that I want to constrain the resizing so the aspect ratio of the window stays constant. Ideally I would like to constrain mouse location when the window is being resized by dragging a corner to positions that maintain the proper aspect ration. If an edge is resized with the mouse, the other dimension should change at the same time. Is there a simple way to do this or a good on-line example that anyone knows of? If no better solutions come up, I'll post what I've done after I've refined it a bit.

    Read the article

  • Cross browser div center alignment using CSS

    - by Misha Moroshko
    What is the easiest way to align a div whose position is relative horizontally and vertically using CSS ? The width and the height of the div is unknown, i.e. it should work for every div dimension and in all major browsers. I mean center alignment. I thought to make the horizontal alignment using: margin-left: auto; margin-right: auto; like I did here. Is this a good cross browser solution for horizontal alignment ? How could I do the vertical alignment ?

    Read the article

  • Google Analytics API - Tying Behavior to Specific Dates

    - by DavidS
    I am using the API to understand the performance of Adwords ad campaigns. I need to know how to attribute metrics back to the date dimension. For instance, for a given date, if I have 20 clicks, 18 visits, and 3 goal completions, does it mean that: 1) All of these actions happened on the day in question and are otherwise independent (meaning that the 3 goals could have been for people that clicked any time in the past 30 days, not who clicked on that day) 2) The on-site actions are a subset of the click activity on that day (i.e. on that day, 20 people clicked, 18 registered a real visit, and 3 completed a goal) If it is scenario 2, does that mean there is a need to refresh old rows every day? Thanks!

    Read the article

  • Where has my parallel port gone? ioperm(888,1,1) returns -1.

    - by marcusw
    I have an old Dell Dimension 8200 running Gentoo which I use solely to control various things using the parallel port. After shutting it down a few weeks ago, I started it up again today and tried to access the parallel port like I usually do. Unfortunately, my code bombed out when it tried to call ioperm(888,1,1) to grab the parallel port which returned an error code of -1. There have been no changes to the system be it hardware or software, no updates, no tweaking, no dropping the case, no over-amping the data pins, nothing. The port and the software have been working fine for months with no changes, and were working fine when I shut it down last. Running my code with root privileges changes nothing. What is breaking this and how can I fix it?

    Read the article

  • MDX: Aggregates over a set

    - by =!3fb7.13e2.c801.b5f3
    Hi! What I am trying to achieves looks very simple, yet I cannot make it work. My facts are orders which have a date and I have a typical time dimension with the 'Month" and 'Year' levels. I would like to get an output which lists the number of orders for the last 6 months and the total, like this: Oct 2009 20 Nov 2009 30 Dec 2009 25 Jan 2009 15 Feb 2010 45 Mar 2010 5 Total 140 I can create the set with the members Oct 2009 until Mar 2010 and I manage to get this part of my desired output: Oct 2009 20 Nov 2009 30 Dec 2009 25 Jan 2009 15 Feb 2010 45 Mar 2010 5 Just I fail to get the total line.

    Read the article

  • SSRS: Report loading external images, image not found, can I hide the image control

    - by Nauman
    My SSRS report loads logo images for each customer from a customer number specific folder on the report server. I write an expression, to form my URL to the image based on th customer number. ..."http://localhost/images/" + iCustomerNumber.ToString() + "/logo.gif" I am able to get this working, but the problem I face is, when a particular customer doesn't has an image, then my report shows a red X mark in place of the logo. In this case, I expect to hide the image control itself. Any thoughts???? The other dirty solution will be to ensure that each customer specific folder has the designated image! even if there is no logo for a customer, I'll place a blank.gif or a spacer.gif of probably a square pixel in dimension!.

    Read the article

  • JPanel Layout Image Cutoff

    - by Trizicus
    I am adding images to a JPanel but the images are getting cut off. I was originally trying BorderLayout but that only worked for one image and adding others added image cut-off. So I switched to other layouts and the best and closest I could get was BoxLayout however that adds a very large cut-off which is not acceptable either. So basically; How can I add images (from a custom JComponent) to a custom JPanel without bad effects such as the one present in the code. Custom JPanel: import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import javax.swing.BoxLayout; import javax.swing.JPanel; import javax.swing.Timer; public class GraphicsPanel extends JPanel implements MouseListener { private Entity test; private Timer timer; private long startTime = 0; private int numFrames = 0; private float fps = 0.0f; GraphicsPanel() { test = new Entity("test.png"); Thread t1 = new Thread(test); t1.start(); Entity ent2 = new Entity("images.jpg"); ent2.setX(150); ent2.setY(150); Thread t2 = new Thread(ent2); t2.start(); Entity ent3 = new Entity("test.png"); ent3.setX(0); ent3.setY(150); Thread t3 = new Thread(ent3); t3.start(); //ESSENTIAL setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); add(test); add(ent2); add(ent3); //GAMELOOP timer = new Timer(30, new Gameloop(this)); timer.start(); addMouseListener(this); } @Override public void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2 = (Graphics2D) g.create(); g2.setClip(0, 0, getWidth(), getHeight()); g2.setColor(Color.BLACK); g2.drawString("FPS: " + fps, 1, 15); } public void getFPS() { ++numFrames; if (startTime == 0) { startTime = System.currentTimeMillis(); } else { long currentTime = System.currentTimeMillis(); long delta = (currentTime - startTime); if (delta > 1000) { fps = (numFrames * 1000) / delta; numFrames = 0; startTime = currentTime; } } } public void mouseClicked(MouseEvent e) {} public void mousePressed(MouseEvent e) {} public void mouseReleased(MouseEvent e) {} public void mouseEntered(MouseEvent e) { } public void mouseExited(MouseEvent e) { } class Gameloop implements ActionListener { private GraphicsPanel gp; Gameloop(GraphicsPanel gp) { this.gp = gp; } public void actionPerformed(ActionEvent e) { try { gp.getFPS(); gp.repaint(); } catch (Exception ez) { } } } } Main class: import java.awt.EventQueue; import javax.swing.JFrame; public class MainWindow { public static void main(String[] args) { new MainWindow(); } private JFrame frame; private GraphicsPanel gp = new GraphicsPanel(); MainWindow() { EventQueue.invokeLater(new Runnable() { public void run() { frame = new JFrame("Graphics Practice"); frame.setSize(680, 420); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.add(gp); } }); } } Custom JComponent import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.image.BufferedImage; import javax.imageio.ImageIO; import javax.swing.JComponent; public class Entity extends JComponent implements Runnable { private BufferedImage bImg; private int x = 0; private int y = 0; private int entityWidth, entityHeight; private String filename; Entity(String filename) { this.filename = filename; } public void run() { bImg = loadBImage(filename); entityWidth = bImg.getWidth(); entityHeight = bImg.getHeight(); setPreferredSize(new Dimension(entityWidth, entityHeight)); } @Override public void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2d = (Graphics2D) g.create(); g2d.drawImage(bImg, x, y, null); g2d.dispose(); } public BufferedImage loadBImage(String filename) { try { bImg = ImageIO.read(getClass().getResource(filename)); } catch (Exception e) { } return bImg; } public int getEntityWidth() { return entityWidth; } public int getEntityHeight() { return entityHeight; } public int getX() { return x; } public int getY() { return y; } public void setX(int x) { this.x = x; } public void setY(int y) { this.y = y; } }

    Read the article

  • capturing video from ip camera

    - by Ruby
    I am trying to capture video from ip camera into my application , its giving exception com.sun.image.codec.jpeg.ImageFormatException: Not a JPEG file: starts with 0x0d 0x0a at sun.awt.image.codec.JPEGImageDecoderImpl.readJPEGStream(Native Method) at sun.awt.image.codec.JPEGImageDecoderImpl.decodeAsBufferedImage(Unknown Source) at test.AxisCamera1.readJPG(AxisCamera1.java:130) at test.AxisCamera1.readMJPGStream(AxisCamera1.java:121) at test.AxisCamera1.readStream(AxisCamera1.java:100) at test.AxisCamera1.run(AxisCamera1.java:171) at java.lang.Thread.run(Unknown Source) its giving exception at image = decoder.decodeAsBufferedImage(); Here is the code i am trying private static final long serialVersionUID = 1L; public boolean useMJPGStream = true; public String jpgURL = "http://ip here/video.cgi/jpg/image.cgi?resolution=640×480"; public String mjpgURL = "http://ip here /video.cgi/mjpg/video.cgi?resolution=640×480"; DataInputStream dis; private BufferedImage image = null; public Dimension imageSize = null; public boolean connected = false; private boolean initCompleted = false; HttpURLConnection huc = null; Component parent; /** Creates a new instance of AxisCamera */ public AxisCamera1(Component parent_) { parent = parent_; } public void connect() { try { URL u = new URL(useMJPGStream ? mjpgURL : jpgURL); huc = (HttpURLConnection) u.openConnection(); // System.out.println(huc.getContentType()); InputStream is = huc.getInputStream(); connected = true; BufferedInputStream bis = new BufferedInputStream(is); dis = new DataInputStream(bis); if (!initCompleted) initDisplay(); } catch (IOException e) { // incase no connection exists wait and try // again, instead of printing the error try { huc.disconnect(); Thread.sleep(60); } catch (InterruptedException ie) { huc.disconnect(); connect(); } connect(); } catch (Exception e) { ; } } public void initDisplay() { // setup the display if (useMJPGStream) readMJPGStream(); else { readJPG(); disconnect(); } imageSize = new Dimension(image.getWidth(this), image.getHeight(this)); setPreferredSize(imageSize); parent.setSize(imageSize); parent.validate(); initCompleted = true; } public void disconnect() { try { if (connected) { dis.close(); connected = false; } } catch (Exception e) { ; } } public void paint(Graphics g) { // used to set the image on the panel if (image != null) g.drawImage(image, 0, 0, this); } public void readStream() { // the basic method to continuously read the // stream try { if (useMJPGStream) { while (true) { readMJPGStream(); parent.repaint(); } } else { while (true) { connect(); readJPG(); parent.repaint(); disconnect(); } } } catch (Exception e) { ; } } public void readMJPGStream() { // preprocess the mjpg stream to remove the // mjpg encapsulation readLine(3, dis); // discard the first 3 lines readJPG(); readLine(2, dis); // discard the last two lines } public void readJPG() { // read the embedded jpeg image try { JPEGImageDecoder decoder = JPEGCodec.createJPEGDecoder(dis); image = decoder.decodeAsBufferedImage(); } catch (Exception e) { e.printStackTrace(); disconnect(); } } public void readLine(int n, DataInputStream dis) { // used to strip out the // header lines for (int i = 0; i < n; i++) { readLine(dis); } } public void readLine(DataInputStream dis) { try { boolean end = false; String lineEnd = "\n"; // assumes that the end of the line is marked // with this byte[] lineEndBytes = lineEnd.getBytes(); byte[] byteBuf = new byte[lineEndBytes.length]; while (!end) { dis.read(byteBuf, 0, lineEndBytes.length); String t = new String(byteBuf); System.out.print(t); // uncomment if you want to see what the // lines actually look like if (t.equals(lineEnd)) end = true; } } catch (Exception e) { e.printStackTrace(); } } public void run() { System.out.println("in Run..................."); connect(); readStream(); } @SuppressWarnings("deprecation") public static void main(String[] args) { JFrame jframe = new JFrame(); jframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); AxisCamera1 axPanel = new AxisCamera1(jframe); new Thread(axPanel).start(); jframe.getContentPane().add(axPanel); jframe.pack(); jframe.show(); } } Any suggestions what I am doing wrong here??

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >