Search Results

Search found 20556 results on 823 pages for 'image viewer'.

Page 10/823 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • Saving image from Gallery to db - Coursor IllegalStateException

    - by MyWay
    I want to save to db some strings with image. Image can be taken from gallery or user can set the sample one. In the other activity I have a listview which should present the rows with image and name. I'm facing so long this problem. It occurs when I wanna display listview with the image from gallery, If the sample image is saved in the row everything works ok. My problem is similar to this one: how to save image taken from camera and show it to listview - crashes with "IllegalStateException" but I can't find there the solution for me My table in db looks like this: public static final String KEY_ID = "_id"; public static final String ID_DETAILS = "INTEGER PRIMARY KEY AUTOINCREMENT"; public static final int ID_COLUMN = 0; public static final String KEY_NAME = "name"; public static final String NAME_DETAILS = "TEXT NOT NULL"; public static final int NAME_COLUMN = 1; public static final String KEY_DESCRIPTION = "description"; public static final String DESCRIPTION_DETAILS = "TEXT"; public static final int DESCRIPTION_COLUMN = 2; public static final String KEY_IMAGE ="image" ; public static final String IMAGE_DETAILS = "BLOP"; public static final int IMAGE_COLUMN = 3; //method which create our table private static final String CREATE_PRODUCTLIST_IN_DB = "CREATE TABLE " + DB_TABLE + "( " + KEY_ID + " " + ID_DETAILS + ", " + KEY_NAME + " " + NAME_DETAILS + ", " + KEY_DESCRIPTION + " " + DESCRIPTION_DETAILS + ", " + KEY_IMAGE +" " + IMAGE_DETAILS + ");"; inserting statement: public long insertToProductList(String name, String description, byte[] image) { ContentValues value = new ContentValues(); // get the id of column and value value.put(KEY_NAME, name); value.put(KEY_DESCRIPTION, description); value.put(KEY_IMAGE, image); // put into db return db.insert(DB_TABLE, null, value); } Button which add the picture and onActivityResult method which saves the image and put it into the imageview public void AddPicture(View v) { // creating specified intent which have to get data Intent intent = new Intent(Intent.ACTION_PICK); // From where we want choose our pictures intent.setType("image/*"); startActivityForResult(intent, PICK_IMAGE); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { // TODO Auto-generated method stub super.onActivityResult(requestCode, resultCode, data); // if identification code match to the intent, //if yes we know that is our picture, if(requestCode ==PICK_IMAGE ) { // check if the data comes with intent if(data!= null) { Uri chosenImage = data.getData(); String[] filePathColumn = {MediaStore.Images.Media.DATA}; Cursor cursor = getContentResolver().query(chosenImage, filePathColumn, null, null, null); cursor.moveToFirst(); int columnIndex = cursor.getColumnIndex(filePathColumn[0]); String filePat = cursor.getString(columnIndex); cursor.close(); ImageOfProduct = BitmapFactory.decodeFile(filePat); if(ImageOfProduct!=null) { picture.setImageBitmap(ImageOfProduct); } messageDisplayer("got picture, isn't null " + IdOfPicture); } } } Then the code which converts bitmap to byte[] public byte[] bitmapToByteConvert(Bitmap bit ) { // stream of data getted for compressed bitmap ByteArrayOutputStream gettedData = new ByteArrayOutputStream(); // compressing method bit.compress(CompressFormat.PNG, 0, gettedData); // our byte array return gettedData.toByteArray(); } The method which put data to the row: byte[] image=null; // if the name isn't put to the editView if(name.getText().toString().trim().length()== 0) { messageDisplayer("At least you need to type name of product if you want add it to the DB "); } else{ String desc = description.getText().toString(); if(description.getText().toString().trim().length()==0) { messageDisplayer("the description is set as none"); desc = "none"; } DB.open(); if(ImageOfProduct!= null){ image = bitmapToByteConvert(ImageOfProduct); messageDisplayer("image isn't null"); } else { BitmapDrawable drawable = (BitmapDrawable) picture.getDrawable(); image = bitmapToByteConvert(drawable.getBitmap()); } if(image.length>0 && image!=null) { messageDisplayer(Integer.toString(image.length)); } DB.insertToProductList(name.getText().toString(), desc, image ); DB.close(); messageDisplayer("well done you add the product"); finish(); You can see that I'm checking here the length of array to be sure that I don't send empty one. And here is the place where Error appears imo, this code is from activity which presents the listview with data taken from db private void LoadOurLayoutListWithInfo() { // firstly wee need to open connection with db db= new sqliteDB(getApplicationContext()); db.open(); // creating our custom adaprer, the specification of it will be typed // in our own class (MyArrayAdapter) which will be created below ArrayAdapter<ProductFromTable> customAdapter = new MyArrayAdapter(); //get the info from whole table tablecursor = db.getAllColumns(); if(tablecursor != null) { startManagingCursor(tablecursor); tablecursor.moveToFirst(); } // now we moving all info from tablecursor to ourlist if(tablecursor != null && tablecursor.moveToFirst()) { do{ // taking info from row in table int id = tablecursor.getInt(sqliteDB.ID_COLUMN); String name= tablecursor.getString(sqliteDB.NAME_COLUMN); String description= tablecursor.getString(sqliteDB.DESCRIPTION_COLUMN); byte[] image= tablecursor.getBlob(3); tablefromDB.add(new ProductFromTable(id,name,description,image)); // moving until we didn't find last row }while(tablecursor.moveToNext()); } listView = (ListView) findViewById(R.id.tagwriter_listoftags); //as description says // setAdapter = The ListAdapter which is responsible for maintaining //the data backing this list and for producing a view to represent //an item in that data set. listView.setAdapter(customAdapter); } I put the info from row tho objects which are stored in list. I read tones of question but I can't find any solution for me. Everything works when I put the sample image ( which is stored in app res folder ). Thx for any advice

    Read the article

  • Facebook Game Rejected: "Your app icon must not overlap with content in your cover image"

    - by peterwilli
    Sorry if this isnt the right stackexchange site to ask this, it was really hard to determine. My FB game just recently got rejected for 2 reasons. The first I fixed nicely and is irrelevant but the second I just can't see to figure out what they mean and I was hoping someone else got the same issue and did know what they meant. These are the errors: You can ignore the error under "Banners" The web preview of my game looks like this now: All I know is that the rejection has something to do with the cover image, not the icons or the screenshots. Please let me know what to do to get approved. Thanks a lot!

    Read the article

  • Drawing shapes dynamically on an image through web browser

    - by Tom Beech
    We have a scenario where we create floor plans of locations when we visit. The floor plan is finally shown on the web. It's come to the point now where we want to show floor plans but have a key with various items on them, when an item on the key is clicked, the image should highlight all the areas of the floorplan that have that specific item. I guess we're looking for some sort of open standard javascript lib to deal with SVG (has to work pre IE9 so pure SVG wont cut it) and the floor plans have to be able to be created through a .net application to be deployed on the web. I'd rather stay away from flash if at all possible to be honest. Below are a few conceptual images of what we're trying to achieve.

    Read the article

  • Absorbtion 2d image effect

    - by Ed.
    I want to create a specyfic 2d image effect. It consists in modifying a sprite so it looks like it is being zoomed to a point or "absorbed" by that point. I'm not really sure what is the technical name of this effect so I cannot explain it correctly. Here you can see a video of what I'm talking about, it is the effect when the character absorbs the three glyphs. http://www.youtube.com/watch?v=PIo-GddsMcU&t=4m45s What is the name of this effect? How can I implement it with XNA for 2D textures/sprites?

    Read the article

  • Image Recognition (Shape recognition)

    - by mqpasta
    I want to recognize the shapes in the picture by template matching.Is the "ExhaustiveTemplateMatching" is the right option given in Aforge.Net for this purpose.Had anyone tried this class and find it working correctly.How accurate and right choice this class is for achieving my purpose.Suggest any other methods or Alogrithms as well for recognizing shapes by matching template.For example Identifying ComboBox in a picture.

    Read the article

  • How can I do batch image processing with ImageJ in Java or clojure?

    - by Robert McIntyre
    I want to use ImageJ to do some processing of several thousand images. Is there a way to take any general imageJ plugin and apply it to hundreds of images automatically? For example, say I want to take my thousand images and apply a polar transformation to each--- A polar transformation plugin for ImageJ can be found here: http://rsbweb.nih.gov/ij/plugins/polar-transformer.html Great! Let's use it. From: [http://albert.rierol.net/imagej_programming_tutorials.html#How%20to%20automate%20an%20ImageJ%20dialog] I find that I can apply a plugin using the following: (defn x-polar [imageP] (let [thread (Thread/currentThread) options ""] (.setName thread "Run$_polar-transform") (Macro/setOptions thread options) (IJ/runPlugIn imageP "Polar_Transformer" ""))) This is good because it suppresses the dialog which would otherwise pop up for every image. But running this always brings up a window containing the transformed image, when what I want is to simply return the transformed image. The stupidest way to do what I want is to just close the window that comes up and return the image which it was displaying. Does what I want but is absolutely retarded: (defn x-polar [imageP] (let [thread (Thread/currentThread) options ""] (.setName thread "Run$_polar-transform") (Macro/setOptions thread options) (IJ/runPlugIn imageP "Polar_Transformer" "") (let [return-image (IJ/getImage)] (.hide return-image) return-image))) I'm obviously missing something about how to use imageJ plugins in a programming context. Does anyone know the right way to do this? Thanks, --Robert McIntyre

    Read the article

  • How can I do batch image processing with ImageJ in clojure?

    - by Robert McIntyre
    I want to use ImageJ to do some processing of several thousand images. Is there a way to take any general imageJ plugin and apply it to hundreds of images automatically? For example, say I want to take my thousand images and apply a polar transformation to each--- A polar transformation plugin for ImageJ can be found here: http://rsbweb.nih.gov/ij/plugins/polar-transformer.html Great! Let's use it. From: [http://albert.rierol.net/imagej_programming_tutorials.html#How%20to%20automate%20an%20ImageJ%20dialog] I find that I can apply a plugin using the following: (defn x-polar [imageP] (let [thread (Thread/currentThread) options ""] (.setName thread "Run$_polar-transform") (Macro/setOptions thread options) (IJ/runPlugIn imageP "Polar_Transformer" ""))) This is good because it suppresses the dialog which would otherwise pop up for every image. But running this always brings up a window containing the transformed image, when what I want is to simply return the transformed image. The stupidest way to do what I want is to just close the window that comes up and return the image which it was displaying. Does what I want but is absolutely retarded: (defn x-polar [imageP] (let [thread (Thread/currentThread) options ""] (.setName thread "Run$_polar-transform") (Macro/setOptions thread options) (IJ/runPlugIn imageP "Polar_Transformer" "") (let [return-image (IJ/getImage)] (.hide return-image) return-image))) I'm obviously missing something about how to use imageJ plugins in a programming context. Does anyone know the right way to do this? Thanks, --Robert McIntyre

    Read the article

  • Create Dynamic Images using Base Image

    - by Karthik Kastury
    I am creating a Google Maps Social Application.. I have a basic marker that has a blank square in between it where I need to put the user uploaded picture. I already have the user uploaded pictures. Now How do I create these dynamic markers using PHP.. The accepted pictures are jpeg and png. I have heard of the PHP GD Library and would like to know how I can accomplish the task..

    Read the article

  • Scale image to completely fill bounding box

    - by Larsenal
    For instance, if I need to fill a bounding box that is 100px wide by 50px tall, the following input images would have the following behavior: 200w x 200h gets scaled down 50% and 25% gets chopped off the top and bottom. 200w x 100h gets scaled down 50% with no cropping. 100w x 200h gets is not scaled, but 75px get chopped off top and bottom. This seems like it'd be a common resizing function, but I haven't been able to track down an example of the algorithm. Will accept answer in any language including pseudo code. A link to a page with the answer is great too!

    Read the article

  • Image size guidelines

    - by user502014
    Hi all, This may well be a little of an open-ended question The site I am working on requires to be optimised for performance. One of the key areas is to optimise the file sizes of the images used upon the site. Unfortunatley these images are being created by employees who do not have the required knowledge for creating images for the web, and it is my job to produce a set of guidelines for them to use. I was wondering whether there was any resource/guidlines/literature regarding typical images file sizes for images of different dimensions - as I would like to include something like this to aid them to ensure their images are being created properly. Any info would be greatly appreciated. Thanks in advance

    Read the article

  • How to resize a image with jquery

    - by Anders Kitson
    I want to resize a img on a click function. Here is my code that is currently not working. I am not sure if I am doing this correctly at all, any help would be great. <script> $(document).ready(function(){ $("#viewLarge").click( function(){ $("#newsletter").width("950px"); }); }); </script> <a id="viewLarge" class="prepend-7" href="#">View Larger(+)</a> <img id='newsletter' width='630px' src='images/news/hello.jpg'>

    Read the article

  • How to output image via php from another domain

    - by Beck
    Image tag inside email message: <img src="http://www.mydomain.com/image.php?lastest=1"> Part of image.php script: case 'image/gif': header('Content-type: image/gif');$img=@imagecreatefromgif($image['src']);if($img) {imagegif($img);imagedestroy($img);} break; But how i can do the same with this image? http://www.anotherdomain.com/image.gif Thanks.

    Read the article

  • OpenGL not rendering my images to the screen

    - by Brendan Webster
    for some reason my game isn't showing the image I am rendering to the screen. My engine is state based, and at the beginning I set the logo, but it isn't showing on the screen. Here is my method of doing so first I create one image and assign some values to it's preset values. //create one image instance for the logo background O_File.v_Create_Images(1); //set the atributes of the background //first Image O_File.sImage[0].nImageDepth = -30.0f; O_File.sImage[0].sImageLocation = "image.bmp"; //load the images int O_File.v_Load_Images(); Then I load them with DevIL void C_File_Manager::v_Load_Images() { ilGenImages(1, &image); ilBindImage(image); for(int i = 0;i < sImage.size();i++) { success = ilLoadImage(sImage[i].sImageLocation.c_str()); if (success) { success = ilConvertImage(IL_RGBA, IL_UNSIGNED_BYTE); glGenTextures(1, &image); glBindTexture(GL_TEXTURE_2D, image); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexImage2D(GL_TEXTURE_2D, 0, 4, ilGetInteger(IL_IMAGE_WIDTH), ilGetInteger(IL_IMAGE_HEIGHT), 0, ilGetInteger(IL_IMAGE_FORMAT), GL_UNSIGNED_BYTE, ilGetData()); //asign values to the width and height of the image if they are already not assigned if(sImage[i].nImageHeight == 0) sImage[i].nImageHeight = ilGetInteger(IL_IMAGE_HEIGHT); if(sImage[i].nImageWidth == 0) sImage[i].nImageWidth = ilGetInteger(IL_IMAGE_WIDTH); std::cout << sImage[i].nImageHeight << std::endl; const std::string word = sImage[i].sImageLocation.c_str(); std::cout << sImage[i].sImageLocation.c_str() << std::endl; ilLoadImage(word.c_str()); ilDeleteImages(1, &image); } } } and then I apply them to the screen void C_File_Manager::v_Apply_Images() { glMatrixMode(GL_MODELVIEW); glLoadIdentity(); for(int i = 0;i < sImage.size();i++) { //move the image to where it should be on the screen; glTranslatef(sImage[i].nImageX,sImage[i].nImageY,sImage[i].nImageDepth); //rotate image around the 3 axes glRotatef(sImage[i].fImageAngleX,1,0,0); glRotatef(sImage[i].fImageAngleY,0,1,0); glRotatef(sImage[i].fImageAngleZ,0,0,1); //scale the image glScalef(1,1,1); //center the image glTranslatef((sImage[i].nImageWidth/2),(sImage[i].nImageHeight/2),0); //draw the box that will encase the loaded image glBegin(GL_QUADS); //change the color of the loaded image; glColor4f(1,1,1,1); //top left corner of image glNormal3f(0.0,0,0.0); glTexCoord2f (1.0, 0.0); glVertex3f(0,0,sImage[i].nImageDepth); //top right corner of image glNormal3f(1.0,0,0.0); glTexCoord2f (1.0, 1.0); glVertex3f(0,sImage[i].nImageHeight,sImage[i].nImageDepth); //bottom right corner of image glNormal3f(-1.0,0,0.0); glTexCoord2f (0.0, 1.0); glVertex3f(sImage[i].nImageWidth,sImage[i].nImageHeight,sImage[i].nImageDepth); //bottom left corner of image glNormal3f(-1.0,0,0.0); glTexCoord2f(0.0, 0.0); glVertex3f(sImage[i].nImageWidth,0,sImage[i].nImageDepth); glEnd(); } } when I debug there is no errors at all, but yet the images don't show up on the screen, I have positioned the camera at (0,0,-1) and that is where the images should show up. the clipping plane is set 1 to 1000. There is probably some random problem with the code, but I just can't catch it.

    Read the article

  • Are there algorithms for increasing resolution of an image?

    - by David
    Are there any algorithms or tools that can increase the resolution of an image - besides just a simple zoom that makes each individual pixel in the image a little larger? I realize that such an algorithm would have to invent pixels that don't really exist in the original image, but I figured there might be some algorithm that could intelligently figure out what pixels to add to the image to increase its resolution.

    Read the article

  • knife azure image list doesn't return User image

    - by TooLSHeD
    I'm trying to create and bootstrap a Windows VM in Azure using knife-azure. I initially tried using a Public Win 2008 r2 image, but quickly found out that winrm needs to be configured before this can work. So, I created a VM from that image, configured winrm as per these instructions and captured the VM. The problem is that the image does not show up when executing knife azure image list. When I try creating the server with the image name from the Azure portal, it complains that it does not exist. I'm running Ubuntu, so I tried the Azure cli tools and it doesn't show there either. I installed Azure PS in a Win 8 VM and then it shows up. Feeling encouraged, I installed Chef and knife-azure in the Win 8 VM, but it doesn't show up there either. How do I get my User image to show in knife azure?

    Read the article

  • ASP.NET MVC Image refreshing

    - by user295541
    Hi, I have an Employee object which has an image property. Image class contains image metadata as image caption, and image file name. If I upload a new image for an employee on async way without full post back the new image is not appeared on the page. I use GUID to name the image file to avoid the page caching. I do the image modifying the following way: ctrEmployee employee = Repository.Get(PassedItemID); if (employee.ctrImage != null) { string fullFileName = serverFolder + employee.ctrImage.FileName; FileInfo TheFile = new FileInfo(fullFileName); if (TheFile.Exists) { TheFile.Delete(); } fileName = Guid.NewGuid() + ".jpg"; employee.ctrImage.FileName = fileName; } resizedBmp.Save(string.Format("{0}{1}", serverFolder, fileName), System.Drawing.Imaging.ImageFormat.Jpeg); Repository.Edit<ctrEmployee>(employee); ImageID = employee.Image.Value; return PartialView(UserControlPaths.Thumbnail, new ThumbnailDataModel(employee.Image.Value, 150, 150)); The partial view has an image tag which gets the saved image url string which is a GUID. Anybody has an idea what I do wrong?

    Read the article

  • Opencv: Converting hue image to RGB image

    - by jhaip
    I am trying to show the hue component of the image from my webcam. I have split apart the image into the hue component but I can't figure out how to show the hue component as the pure colors. For example if one pixel of the image was B=189 G=60 R=60 then in HSV, H=0. I don't want the draw image to be the the gray values of hue but the RGB equivalent of the hue or H=0 - B=0 G=0 R=255 IplImage *image, *imageHSV, *imageHue; image = cvQueryFrame(capture); //image from webcam imageHSV = cvCreateImage( cvGetSize(image), IPL_DEPTH_8U, 3 ); imageHue = cvCreateImage( cvGetSize(image), IPL_DEPTH_8U, 1 ); cvCvtColor( image, imageHSV, CV_BGR2HSV ); cvSplit( imageHSV, imageHue, 0, 0, 0 ); I have a feeling there is a simple solution so any help is appreciated.

    Read the article

  • JSON image viewer not working in firefox

    - by jarga
    I have tried to find out why JSON is not working in Firefox all over this forum and the internet. It works on tablets, ie, safari. It works on my desktop in firefox. It only does not work after uploading I've tried a few things (commented out), such as mimeType with no solution. I have tried using the $.ajax with no better luck. Firefox had no javascript errors. I'm using jQuery 1.7. Console.log is printing out the data. $(document).ready(function(){ jQuery.support.cors = true; //$.ajaxSetup({ mimeType: "application/json" }); /*$.ajaxSetup({ scriptCharset: "utf-8" , contentType: "application/json; charset=utf-8"}); */ // loading pictures $.getJSON("intro.json?format=json", function(data){ var links = ''; var imageload = ''; var title = ''; console.log(data) $.each(data, function(key, item){ links += ' <a href=' + item.image + '>' + key + '</a>'; imageload += '<img src="' + item.image + ' " />'; title += item.alt; }); $('.introCon').html(imageload); $('.introCon img').hide(); $('.introCon img:last').fadeIn(500); $('.introCon img').fadeIn(1000); rotatePics(2); }); }); function rotatePics(currentPhoto) { var numberOfPhotos = $('.introCon img').length; currentPhoto = currentPhoto % numberOfPhotos; $('.introCon img').eq(currentPhoto).fadeOut( function() { // re-order the z-index $('.introCon img').each(function(i) { $(this).css( 'zIndex', ((numberOfPhotos - i) + currentPhoto) % numberOfPhotos ); }); $(this).show(); setTimeout(function() {rotatePics(++currentPhoto);}, 3000); }); } Here is the simple JSON from a separate file. { "1" : { "image" : "portfolio/chrpic.png", "alt" : "Blah.", "detail": "Quartz"}, "2" : { "image" : "portfolio/mysspic.png", "alt" : "Landing page.", "detail": "Container"}, "3" : { "image" : "portfolio/decode-pic3.png", "alt" : "Decode this.", "detail": "Landing page 2"}, "4" : { "image" : "portfolio/simple-think-pic.png", "alt" : "Simple Think", "detail": "simpilify your life"} }

    Read the article

  • Simple but efficient way to store a series of small changes to an image?

    - by finnw
    I have a series of images. Each one is typically (but not always) similar to the previous one, with 3 or 4 small rectangular regions updated. I need to record these changes using a minimum of disk space. The source images are not compressed, but I would like the deltas to be compressed. I need to be able to recreate the images exactly as input (so a lossy video codec is not appropriate.) I am thinking of something along the lines of: Composite the new image with a negative of the old image Save the composited image in any common format that can compress using RLE (probably PNG.) Recreate the second image by compositing the previous image with the delta. Although the images have an alpha channel, I can ignore it for the purposes of this function. Is there an easy-to-implement algorithm or free Java library with this capability?

    Read the article

  • How to make Ultra VNC viewer faster ?

    - by karthik
    I am trying to share the screen of a system A to another system B. The normal screen sharing is good. But when i run a 3-D program in System A and try to view it from System B, i see the screen frame by frame. The response time is too slow. My Req. is to show the 3-D program to another person. How can i make VNC faster, to its best ?

    Read the article

  • C# .NET : Is using the .NET Image Conversion enough?

    - by contactmatt
    I've seen a lot of people try to code their own image conversion techniques. It often seems to be very complicated, and ends up using GDI+ funciton calls, and manipulating bits of the image. This has got me wondering if I am missing something in the simplicity of .NET's image conversion call when saving an image. Here's the code I have Bitmap tempBmp = new Bitmap("c:\temp\img.jpg"); Bitmap bmp = new Bitmap(tempBmp, 800, 600); bmp.Save(c:\temp\img.bmp, //extension depends on format ImageFormat.Bmp) //These are all the ImageFormats I allow conversion to within the program. Ignore the syntax for a second ;) ImageFormat.Gif) //or ImageFormat.Jpeg) //or ImageFormat.Png) //or ImageFormat.Tiff) //or ImageFormat.Wmf) //or ImageFormat.Bmp)//or ); This is all I'm doing in my image conversion. Just setting the location of where the image should be saved, and passing it an ImageFormat type. I've tested it the best I can, but I'm wondering if I am missing anything in this simple format conversion, or if this is suffice?

    Read the article

  • How to center align background image in JPanel

    - by Jaguar
    I wanted to add background image to my JFrame. Background image means I can later add Components on the JFrame or JPanel Although I coudn't find how to add background image to a JFrame, I found out how to add background image to a JPanel from here: How to set background image in Java? This solved my problem, but now since my JFrame is resizable I want to keep the image in center. The code I found uses this method public void paintComponent(Graphics g) { //Draw the previously loaded image to Component. g.drawImage(img, 0, 0, null); //Draw image } Can anyone say how to align the image to center of the JPanel. As g.drawImage(img, 0, 0, null); provides x=0 and y=0 Also if there is a method to add background image to a JFrame then I would like to know. Thanks.

    Read the article

  • Using glReadBuffer returns black image instead of the actual image only on Intel cards

    - by cloudraven
    I have this piece of code glReadBuffer( GL_FRONT ); glReadPixels( 0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, buffer ); Which works just perfectly in all the Nvidia and AMD GPUs I have tried, but it fails in almost every single Intel built-in video that I have tried. It actually works in a very old 945GME, but fails in all the others. Instead of getting a screenshot I am actually getting a black screen. If it helps, I am working with the Doom3 Engine, and that code is derived from the built-in screen capture code. By the way, even with the original game I cannot do screen capture on those intel devices anyway. My guess is that they are not implementing the standard correctly or something. Is there a workaround for this?

    Read the article

  • Using glReadBuffer/glReadPixels returns black image instead of the actual image only on Intel cards

    - by cloudraven
    I have this piece of code glReadBuffer( GL_FRONT ); glReadPixels( 0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, buffer ); Which works just perfectly in all the Nvidia and AMD GPUs I have tried, but it fails in almost every single Intel built-in video that I have tried. It actually works in a very old 945GME, but fails in all the others. Instead of getting a screenshot I am actually getting a black screen. If it helps, I am working with the Doom3 Engine, and that code is derived from the built-in screen capture code. By the way, even with the original game I cannot do screen capture on those intel devices anyway. My guess is that they are not implementing the standard correctly or something. Is there a workaround for this?

    Read the article

  • how to display a image in java application

    - by Nubkadiya
    i want to display a image in my java application. i found a code to download the image from the webserver. what that code do is it takes the image and show it in the jframe. i want to use a label to show the image or soemthing else. so i can put it in my java application. can someone help me. it shouldnt be JFrame please help me here is my code Image image = null; try { URL url = new URL("http://www.personal.psu.edu/acr117/blogs/audrey/images/image-2.jpg"); image = ImageIO.read(url); } catch (IOException e) { } // Use a label to display the image JFrame frame = new JFrame(); JLabel lblimage = new JLabel(new ImageIcon(image)); frame.getContentPane().add(lblimage, BorderLayout.CENTER); frame.setSize(300, 400); frame.setVisible(true); } can someone help me

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >