Search Results

Search found 20316 results on 813 pages for 'image manipulation'.

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

  • Slick2D - Cannot instantiate the type Image

    - by speakon
    I am getting this strange error and I cannot for the life of me figure out why: Cannot instantiate the type Image CODE: import java.awt.Image; import org.newdawn.slick.GameContainer; import org.newdawn.slick.Graphics; import org.newdawn.slick.SlickException; import org.newdawn.slick.state.BasicGameState; import org.newdawn.slick.state.StateBasedGame; public class MainMenuState extends BasicGameState { int stateID = -1; Image background = null; Image startGameOption = null; Image exitOption = null; float startGameScale = 1; float exitScale = 1; MainMenuState( int stateID ) { this.stateID = stateID; } public int getID() { return stateID; } public void init(GameContainer gc, StateBasedGame sbg) throws SlickException { try { background = new Image("data/menu.jpg"); Image menuOptions = new Image("data/menuoptions.png"); startGameOption = menuOptions.getSubImage(0, 0, 377, 71); exitOption = menuOptions.getSubImage(0, 71, 377, 71); }catch (SlickException e) { System.err.print(e); } } public void render(GameContainer gc, StateBasedGame sbg, Graphics g) throws SlickException { } public void update(GameContainer gc, StateBasedGame sbg, int delta) throws SlickException { } } Why do I get this error? I've googled endlessly and nobody else has it, this worked fine in my other game. Any ideas?

    Read the article

  • Get remote image dimensions

    - by o-logn
    Given a URL to an image (and not the image itself), what's the most efficient of getting it's dimensions? I would like to change the height and width attributes in the image tag (<img>) if it is greater than 200x200. However, if it's smaller than that, then I'd like to keep the size as it is. (I'm using ASP.NET/C#)

    Read the article

  • Manipulating / Resizing / Scaling an image in vb.net

    - by Christian Payne
    Imagine I have a rectangle say 400px x 300px. Then let’s say I want to load an image in that. All of this is very easy using Sytem.Drawing.DrawImage. But then I want to leave the left hand side as 300px but change the right hand side to 250 px. I can draw the box using 4 DrawLines but I don’t know how to squash the image into the new shape. I want the right hand side of the shape to be 250, the left size 300 and the top and bottom 400px. I can’t use DrawImage as it expects the left and right sizes to be the same. Is there a way to manipulate the image into the new shape? I've looked at other questions, but they only apply where the left and right hand side is equal. Any thoughts on how to squash an image into a shape which did not have parallel sides? (If it helps, I'm happy to sacrifice image quality to fit the right shape.)

    Read the article

  • Scaling larger Image problem.

    - by krishna
    Hi, I m developing flex application, in which I want to Draw Image from User local hard-drive to the canvas of size 640x360. User can choose Image of bigger resolution & is scaled to Canvas size. But if user selected images of larger resolution like 3000x2000, the scaling take lot time & freezes the application until scale done. Is there any method to scale image faster or kind of threading can be done? I am using matrix to scale Image as below: var mat:Matrix = new Matrix(); var scalex:Number = canvasScreen.width/content.width; var scaley:Number = canvasScreen.height/content.height; mat.scale(scalex,scaley); canvasScreen.graphics.clear(); canvasScreen.graphics.beginBitmapFill(content.bitmapData,mat);

    Read the article

  • Could anyone suggest me some image manipulation techniques to be added to my image viewer??

    - by avi
    Hello, I'm trying to develop a small image viewer just as an exercise to sharpen my programming skills. So far , all the features that I could think of adding to it are zooming in and out, inverting the colors of the image and resizing. Could anyone suggest me a few more features?? You are also welcome to suggest anything which has not been implemented yet. I would like to take it as a learning challenge. Thanks.

    Read the article

  • PHP Scale image and then create image of specific size

    - by Ronny vdb
    The result I am trying to achieve is that the user can upload an image of any size, and the server side script will convert it to an image that has the dimension 1024x512. To save the aspect ratio of the image I first scale the image down by either the width or height to match the wanted dimensions. to do this I am using imagecopyresampled(): imagecopyresampled( $new_img, $src_img, $dst_x, $dst_y, 0, 0, $new_width, $new_height, $img_width, $img_height ) && $write_image($new_img, $new_file_path, $image_quality); If we take an image that is 1920x1200 as an example, the outputted image will be 819x512. However I still need a final result of 1024x512 so I want to add white borders to the image to will the width to 1024. How can I correct my imagecopyresampled function to acheive this?

    Read the article

  • Error loading PCX image in FreeImage library

    - by khanhhh89
    I'm using FreeImage in C++ for loading texuture from the PCX image. My FreeImage code is as following: FREE_IMAGE_FORMAT fif = FIF_UNKNOWN; //pointer to the image data BYTE* bits(0); fif = FreeImage_GetFileType(m_fileName.c_str(), 0); if (FreeImage_FIFSupportsReading(fif)) dib = FreeImage_Load(fif, m_fileName.c_str()); //retrieve the image data bits = FreeImage_GetBits(dib); //get the image width and height width = FreeImage_GetWidth(dib); height = FreeImage_GetHeight(dib); My problem is the width and height variable are both 512, while the bits array is an empty string, which make the following OPENGL call corrupt: glTexImage2D(m_textureTarget, 0, GL_RGB, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, bits); While debugging, I notice that the "fif" variable (which contains the format of the image) is JPEG, while the Image is actually PCX. I wonder whether or not the FreeImage recognize the wrong format (from PCX to JPEG), so tha the bits array is an empty string. I hope to see your explanation about this problem. Thanks so much

    Read the article

  • Image in Image Algorithm

    - by Paul
    I need an algorithm written in any language to find an image inside of an image, including at different scales. Does anyone know a starting point to solving a problem like this? For example: I have an image of 800x600 and in that image is a yellow ball measuring 180 pixels in circumference. I need to be able to find this image with a search pattern of a yellow ball having a circumference of 15 pixels. Thanks

    Read the article

  • Inline image and caption in article - conform caption's width to image's width

    - by Micah
    Here's my code: <div class="image"> <img src="image.jpg" alt="Image description" /> <p class="caption">This is the image caption</p> </div> Here's my CSS: .image { position: relative; float: right; margin: 8px 0 10px 10px; } .caption { font-weight: bold; color: #444666; } As is above, the caption will conform to the width of div.image. My problem is often the img varies in size, from 100px width to 250px width. I'd like to make the caption width conform to the corresponding width of the image, no matter the size. While I'd love for this to be more semantic as well, I'm not sure how easy it would be to switch p.caption with img. Of course, I'd prefer that method but am taking this a step at a time. Is there some jquery code that I can use to detect the width of the image and add that width as an inline style to the caption tag? Is there a better way to do this? I'm open to suggestions.

    Read the article

  • Calculating length of objects in binary image - algorithm

    - by Jacek
    I need to calculate length of the object in a binary image (maximum distance between the pixels inside the object). As it is a binary image, so we might consider it a 2D array with values 0 (white) and 1 (black). The thing I need is a clever (and preferably simple) algorithm to perform this operation. Keep in mind there are many objects in the image. The image to clarify: Sample input image:

    Read the article

  • Displaying Image On SmallBASIC

    - by Nathan Campos
    I want to display a image using SmallBASIC. For this I've started by searching on the references, then I found a reference for IMAGE, that is like this: IMAGE #handle, index, x, y [,sx,sy [,w,h]] Then I found another to open files(OPEN): OPEN file [FOR {INPUT|OUTPUT|APPEND}] AS #fileN But I want to know some things: What image types this function can display? There is any real example to use IMAGE?

    Read the article

  • How do i resize image file to optional sizes

    - by shuxer
    Hi I have image upload form, user attaches aimage file, and selects image size to resize the uploaded image file(200kb, 500kb, 1mb, 5mb, Original). Then my script needs to resize image file size based on user's optional size, but im not sure how to implement this feature, For example, user uploads image with one 1mb size, and if user selects 200KB to resize, then my script should save it with 200kb size. Does anyone know or have an experience on similar task ? Thanks for you reply in advance.

    Read the article

  • Image Classification - Detecting an image is cartoon-like

    - by kingb
    I have a large amount of jpeg thumbnail images ranging in size from 120x90 to 320x240 and I would like to classify them as either Real Life-like or Cartoon-like. Are there any applications that will have cartoon classification capabilities? This application should work on Linux, and should take an image path on the command-line and return either 0 or 1 (echo $?).

    Read the article

  • Online medical image processing grand challenges

    - by taltos
    Hello! I moved my question from stackoverflow here. I cherish the hope that I will be luckier. I'm currently working on my thesis, and I'm looking for an/some online medical image processing grand challenge(s). I already know this site but I need a challenge which has microscopic image dataset like cells, chromosomes, bacterias, viruses etc with classification or recognation objective. Like karyotyping. Maybe someone is working on this field or his university made a challenge what I'm looking for, and can help me. Thank you!

    Read the article

  • Serverside image processing

    - by spol
    I am designing a web application that does server side image processing in real time. Processing tasks include applying different effects like grayscale, blur, oil paint, pencil sketch etc on images in various formats. I want to build it using java/servlets which I am already familiar with. I found 3 options, 1) Use pure java imaging libraries like java.awt or http://www.jhlabs.com/ip/index.html 2) Use command line tools like Gimp/ImageMagick 3) Use c,c++ image libraries that have java bindings. I don't know which of the above options is good keeping the performance in mind. It looks like option 2) and 3) are good performance wise, but I want to be sure before I rule out 1). I have also heard gimp cannot be run using command line unless gtk or xwindows is already installed on the server. Will there be any such problems with 2) or 3) while running them server side? Also please suggest any good image processing libraries for this purpose.

    Read the article

  • Image bit depth values.

    - by pencilslate
    REPHRASED QUESTION: I am coming up with a list of possible image bit depth values that could be used as a predefined reference list in my application. I could think of 8,16,24 and 32 bit depths. The image formats considered are BMP, JPEG, PNG and GIF. I understand the bit depth decides the quality and thereby the storage requirements for the image. The application is used to store user uploaded images(non-medical, non-DICOM). Are there more bit depths other than the ones mentioned above that i should be including in my list? Are there any stats on the usage of the images with bit depths? Appreciate your response!

    Read the article

  • Wrong image dimensions when it's dynamically loaded on a page the 1st time

    - by Nikita Barsukov
    I have the following piece of Javascript code on my web-page var central_image = document.createElement("img") central_image.setAttribute("src", imgs[curr_image_no - 1]); central_image.setAttribute("name", "jpeg"); document.getElementById("photo").appendChild(central_image); central_image.onload = getDimensions(); //function that alerts image dimensions Now, when the central_image is loaded for the 1st time in Firefox, its height always equals to 0. In IE its dimensions are 28 x 30 pixels. When I reload image, its dimensions are OK in both browsers. I guess the problem is that function getDimensions() starts before image was loaded completely. How to change that?

    Read the article

  • Multiple ToggleButton image with different highlight image in WPF

    - by Ryan
    I am very new to WPF and needed some pointers as to why this is not working correctly. I am trying to make a maximize button that will change to a restore button when clicked. I thought a toggle button with 2 different styles that would be changed in the code behind could work. I am first trying to get the maximize button working and have ran into a problem. I get the error 'System.Windows.Controls.Image' is not a valid value for the 'System.Windows.Controls.Image.Source' property on a Setter. in my xaml. I seem to be not understanding something completely. Any help would be most helpful :) Ryan <Style x:Key="Maximize" TargetType="{x:Type ToggleButton}"> <Style.Resources> <Image x:Key="MaxButtonImg" Source="/Project;component/Images/maxbutton.png" /> <Image x:Key="MaxButtonHighlight" Source="/Project;component/Images/maxbutton-highlight.png" /> </Style.Resources> <Setter Property="ContentTemplate"> <Setter.Value> <Image> <Image.Style> <Style TargetType="{x:Type Image}"> <Setter Property="Source" Value="{DynamicResource MaxButtonImg}"/> <Style.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="Source" Value="{DynamicResource MaxButtonHighlight}"/> </Trigger> </Style.Triggers> </Style> </Image.Style> </Image> </Setter.Value> </Setter> </Style> <ToggleButton Name="MaxButton" Width="31" Height="31" BorderThickness="0" Click="MaxButton_Click" Margin="0,0,10,0" Tag="Max" Style="{DynamicResource Maximize}" /> My code behind would do something simple like this: private void MaxButton_Click(object sender, RoutedEventArgs e) { ToggleButton tg = (ToggleButton)sender; if ( tg.IsChecked == true) { tg.Style = (Style)FindResource("Restore"); this.WindowState = WindowState.Maximized; } else { tg.Style = (Style)FindResource("Maximize"); this.WindowState = WindowState.Normal; } }

    Read the article

  • J2ME Reduce Image color-depth/ Compress Image size

    - by updateraj
    Hi, I need to transmit the image from the mobile phone to the server. I am able to reduce the image screen size but not the memory size. I understand i have to deal with the color depth. J2ME does not seem to offer any scaling method which is available in J2SE: image rescaled = image.getScaledInstance(thumbWidth, thumbHeight, Image.SCALE_AREA_AVERAGING); BufferedImage biRescaled = toBufferedImage(rescaled, thumbWidth, thumbHeight, BufferedImage.TYPE_INT_RGB); How i would i tackle this ? I would like to reduce the image memory size before i transmit to the server. Thank you

    Read the article

  • Convert inline image tags like [image:123:title:size] into HTML img tags

    - by Jacques Joubert
    I am looking for help with regular expression $pattern to convert inline image tags like [image:123:title:size] into HTML img tags. here is the code: //[image:ID:caption:size] $content = '[image:38:title:800x900]'; preg_match_all( '/\[image:(\d+)(:?)([^\]]*)\]/i', $content, $images ); if( !empty( $images[0] ) ) { // There are image inline tags in the content foreach( $images[0] as $i => $tag ) { $link_ID = (int)$images[1][$i]; $caption = empty( $images[2][$i] ) ? '#' : $images[3][$i]; $size = empty( $images[4][$i] ) ? '#' : $images[4][$i]; } echo '<br />'; echo 'ID: '.$link_ID.'<br />'; echo 'Tag: '.$caption.'<br />'; echo 'size: '.$size.'<br />'; } which outputs: ID: 12 Tag: caption:size size: # Any help would be great!

    Read the article

  • how to display a image in java application after downloading the image

    - by Nubkadiya
    i want to display a image after downloading that image from a web-server i have wrote the code for downloading the image. but i cant set it up to a label or any thing other than jframe (because i want to add more buttons and labels to the GUI). here is the code to download the image from the webserver. now i want to set it to a label. please help me URL url = new URL("http://www.personal.psu.edu/acr117/blogs/audrey/images/image-2.jpg"); image = ImageIO.read(url);

    Read the article

  • how to get transform a local image to a web accessable image

    - by hguser
    Hi: Generally,if we want to display a image in the web page,we give the uri of the image resource like: http://host:port/image/xxx.jpg. Now,there are some images in my file system,and I save its absolute path in the db. Like this; id name address image 1 xxxx xxxx C:/images/xxx.jpg Now if the entity is retrived,its image should be displayed in the page. How to make it? What I thought is copy the image under the web server dir,then build its url,then the page can render it. But I wonder if this is a good idea? Is there any other way?

    Read the article

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