Search Results

Search found 25888 results on 1036 pages for 'image map'.

Page 29/1036 | < Previous Page | 25 26 27 28 29 30 31 32 33 34 35 36  | Next Page >

  • Servlet send image from server and save in client

    - by sangi
    Hi, I'm new and just developing on J2EE. I am modifying an existing application (an OpenSource project). I need to save an image on a client sent by the server, but I do not know how. This activity must be done in a transparent manner without affecting the existing operation of the application. From the tests done I get this error: java.lang.IllegalStateException: getWriter () has Already Been Called for this response. How should carry out this task, according to your own opinion? How do I save on the client, locally, the image? Update: Thanks for the answers. My problem is that: the image is generated on the server, but not for direct client request (there is no link to click on web page), the picture is composed using other services on the Internet. reconstruct the image on the server. This image must be sent to the client to be saved locally. so I'd like it to appear a window where you assign the destination image plus I'd like the rest of the application were not affected by this activity. The application is yet on production. Thank you very much for your response.

    Read the article

  • Problem with loading a PNG image in JApplet.

    - by Bruce
    Hi there, I'm trying to load a PNG image from JAR file when running JApplet. The file is, I think, loaded properly - there are no errors. However it is not displayed. img.png is placed in the same directory as MainClass.java file. Here is the code: InputStream imageURL = this.getClass().getResourceAsStream("img.png" ); byte[] bytes = null; try {bytes = new byte[imageURL.available()]; System.out.println(imageURL.available()); imageURL.read(bytes);} catch(Exception e) {System.out.println("bleah");} Image image = Toolkit.getDefaultToolkit().createImage(bytes); Image imageScaled = me.getScaledInstance( 100, 150, Image.SCALE_SMOOTH ); jLabel6 = new javax.swing.JLabel( new ImageIcon( imageScaled) ); and the HTML exerpt: <APPLET codebase="classes" code="myapplet/MainClass.class" archive ="LittleApplet.jar" width=700 height=500> The image, as I wrote, is probably read, but not displayed in JLabel. What am I missing/doing wrong? Thanks in advance for the reply!

    Read the article

  • Set a color as transparent in palette-based image

    - by NeDark
    Hello there! I want to convert a alpha transparent png image to palette based png image. In GD I can do it easy: // We have already the image loaded in $source_img $w=200; $h=200; // We supose that img dimensions are 200x200 $img = imagecreatetruecolor($w, $h); // New black image list($r, $g, $b) = array(200, 200, 200); // Some color that doesn't appear in image to avoid conflict $color = imagecolorallocate($img, $r, $g, $b); imagefill($img, 0, 0, $color); // Fill the black image with the chosen color. imagecolortransparent($img, $color); // Set the chosen color as transparent $res = imagecopyresampled($img, $source_img, 0, 0, 0, 0, $w, $h, $w, $h); But in Imagick I don't know how set a color as transparent (imagecolortransparent() in GD). I have spent hours searching on the internet, but the help in the php site isn't very comphrensive and there are many undocumented functions. Thanks.

    Read the article

  • Fitting Text into an Image

    - by Abs
    Hello all, I have a function which takes in a font (ttf or otf file) and generates an image of text in different fonts. The problem I have is trying to work out how I can make the text fit in the image regardless of the font-size, type of font, and amount of text. I have tried to make the image rectangle variable so that it contains the text of different fonts without cutting a bit of the text since the image is not long or wide enough. Here is the function that I currently have, I have tried using the number of characters to determine the width of the image, but in some cases for some fonts and sizes, it still gets cut off. function generate_image($save_path, $text, $font_path){ $length = strlen($text) * 15; // Create the image $im = imagecreatetruecolor($length, 40); $white = imagecolorallocate($im, 255, 255, 255); $grey = imagecolorallocate($im, 128, 128, 128); $black = imagecolorallocate($im, 0, 0, 0); imagefilledrectangle($im, 0, 0, $length, 40, $white); $font = $font_path; imagettftext($im, 30, 0, 0, 25, $black, $font, $text); if(imagepng($im, $save_path)){ $status = true; }else{ $status = false; } imagedestroy($im); return $status; } Thank you all for any help

    Read the article

  • java gui image problem : doesn't display in the background

    - by thegamer
    Hello, i have a query about why is my image not being displayed in my background of my program. I mean i did all the steps necessary and still it would'nt be displayed. The code runs perfectly but without having the image displayed. The directory is written in the good location of the image. I am using java with gui. If anyone could help me solve my problem, i would appreciate :) here is the code below: import java.awt.*; import java.awt.event.*; import javax.swing.*; public class hehe extends JPanel{ public hehe(){ setOpaque(false); setLayout(new FlowLayout()); } public static void main (String args[]){ JFrame win = new JFrame("yooooo"); // it is automaticcally hidden JPanel mainPanel = new JPanel(new BorderLayout()); win.add(mainPanel); JLabel titleLabel = new JLabel("title boss"); titleLabel.setFont(new Font("Arial",Font.BOLD,18)); titleLabel.setForeground(Color.blue); mainPanel.add(titleLabel,BorderLayout.NORTH); win.setSize(382,269); // the dimensions of the image win.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); win.setVisible(true); } public void paint(Graphics g) { Image a = Toolkit.getDefaultToolkit().getImage("C:\\Users\\andrea\\Desktop\\Gui\\car"); // car is the name of the image file and is in JPEG g.drawImage(a,0,0,getSize().width,getSize().height,this); super.paint(g); } }

    Read the article

  • Image rotate opecv error

    - by avd
    When I use this code to rotate the image, the destination image size remains same and hence the image gets clipped. Please provide me a way/code snippet to resize accordingly (like matlab does in imrotate) so that image does not get clipped and outlier pixels gets filled with all white instead of black. void imrotate(std::string imgPath,std::string angleStr,std::string outPath) { size_t found1,found2; found1=imgPath.find_last_of('/'); found2=imgPath.size()-4; IplImage* src=cvLoadImage(imgPath.c_str(), -1);; IplImage* dst; dst = cvCloneImage( src ); int angle = atoi(angleStr.c_str()); CvMat* rot_mat = cvCreateMat(2,3,CV_32FC1); CvPoint2D32f center = cvPoint2D32f( src->width/2, src->height/2 ); double scale = 1; cv2DRotationMatrix( center, angle, scale, rot_mat ); cvWarpAffine( src, dst, rot_mat); char angStr[4]; sprintf(angStr,"%d",angle); cvSaveImage(string(outPath+imgPath.substr(found1+1,found2-found1-1)+"_"+angStr+".jpg").c_str(),dst); cvReleaseImage(&src); cvReleaseImage(&dst); cvReleaseMat( &rot_mat ); } Original Image: Rotated Image:

    Read the article

  • Dealing with image upload on server

    - by user1073320
    I have got a the following problem: I have got multi-step form where in one step user upload image to server and then few steps further supplies other information, when this information is invalid no data should be commited - also the image should be deleted. I was thinking about PHP session, but I've read here PHP - Store Images in SESSION data? that it is inefficient way. Every time you proceed step in the form the image is reloaded (in the session) and as somebody mentioned "You will want it to only be as big as it needs to be and you need to delete it as soon as you don't need it because large pieces of information in the session will slow down the session startup." - here i got a question: will it slow down the stratup the session of user who upload file or sessions of all users? I have to mention that I'm looking for solution that doesn't rely on operating system scripts (cron or etc) - I have no permission to run such scripts. The perfect solution for me would be: saving image on disk (for example in some folder named after session id) then after the latest step of form move this image or delete depending on form validation. If user unexpectedly destroy the session (for example closing the browser) of course the folder with image should be deleted. In nutshell I need somethig like callback to event "destroying session".

    Read the article

  • Capturing image with WDS is stuck on 'Capturing Windows Image Metadata'

    - by user74499
    Hello, I'm trying to capture a rather large (100gigs) windows xp partition to a WIM file on an attached USB hard drive. Under 'Task Progress' it's saying 'Capturing Windows image Metadata', which is where it has been for a while (like 1.5 hours) - the blue bar is at the end of the screen, i.e. 100% I can move the windows around the screen so I suspect that the operation hasn't crashed yet but does this part of the process take a long time? I have only ever captured a 3gig partition before. Thanks.

    Read the article

  • Render a 3D image as a 2D vector image

    - by Clinton Blackmore
    Is there any software that will take a 3d model (in any format) and allow you to render it as a 2D vector image (preferable as either an .SVG or .PDF)? My intention is to render LEGO building instructions this way. While there are many tools that let you view them or generate nice, rasterized output, I'd really like to be able to generate vectorized output. Textures are not needed, and hidden line removal may not be needed. I could use a tool that works on any platform (although my preference is OS X, Linux, then Windows). Open source is preferred. If no one knows of a tool that does this, does anyone have a good recommendation of something to hack on and add a feature to output via Cairo?

    Read the article

  • No image from graphics card but image from onboard video

    - by ReAzem
    I have an HD 5970 running on a P8Z68-v LE motherboard and I have no image comming out of the graphic card. When I plug my screen on my motherboard, I see the bios and the OS. When I plug my screen on the graphic card, I don't see anything. I know that the graphic card works because I have tested it on another computer. I know the motherboard works because I tested it with another graphic card and it worked. I know that the graphic card works with the computer because I have another computer with a P8Z68-LE and an HD 5970. I know it is not an OS issue because I should atleast be able to see the bios. I have tried unplugging my HDDs so that the OS dont interfere with anything. Using a 1000W power supply Using another HD5970 on the computer works. So this is a problem with my HD5970, but why is the graphic card working on my other computer?

    Read the article

  • How to detect invalid image URL with JAVA?

    - by Cataclysm
    I have a method to download image from URL. As like below.. public static byte[] downloadImageFromURL(final String strUrl) { InputStream in; ByteArrayOutputStream out = new ByteArrayOutputStream(); try { URL url = new URL(strUrl); in = new BufferedInputStream(url.openStream()); byte[] buf = new byte[2048]; int n = 0; while (-1 != (n = in.read(buf))) { out.write(buf, 0, n); } out.close(); in.close(); } catch (IOException e) { return null; } return out.toByteArray(); } I have an image url and it is valid. for example. https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcTxfYM-hnD-Z80tgWdIgQKchKe-MXVUfTpCw1R5KkfJlbRbgr3Zcg My problem is I don't want to download if image is really not exists.Like .... https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcTxfYM-hnD-Z80tgWdIgQKchKe-MXVUfTpCw1R5KkfJlbRbgr3Zcgaaaaabbbbdddddddddddddddddddddddddddd This image shouldn't be download by my method. So , how can I know the giving image URL is not really exists. I don't want to validate my URL (I think that may not my solution ). So, I googled for that. From this article ... How to check if a URL exists or returns 404 with Java? and Java check if file exists on remote server using its url But this con.getResponseCode() will always return status code "200". This mean my method will also download invalid image urls. So , I output my bufferStream as like... System.out.println(in.read(buf)); Invalid image URL produces "43". So , I add these lines of codes in my method. if (in.read(buf) == 43) { return null; } It is ok. But I don't think that will always satisfy. Has another way to get it ? am I right? I would really appreciate any suggestions. This problem may struct my head. Thanks for reading my question.

    Read the article

  • Segfault when iterating over a map<string, string> and drawing its contents using SDL_TTF

    - by Michael Stahre
    I'm not entirely sure this question belongs on gamedev.stackexchange, but I'm technically working on a game and working with SDL, so it might not be entirely offtopic. I've written a class called DebugText. The point of the class is to have a nice way of printing values of variables to the game screen. The idea is to call SetDebugText() with the variables in question every time they change or, as is currently the case, every time the game's Update() is called. The issue is that when iterating over the map that contains my variables and their latest updated values, I get segfaults. See the comments in DrawDebugText() below, it specifies where the error happens. I've tried splitting the calls to it-first and it-second into separate lines and found that the problem doesn't always happen when calling it-first. It alters between it-first and it-second. I can't find a pattern. It doesn't fail on every call to DrawDebugText() either. It might fail on the third time DrawDebugText() is called, or it might fail on the fourth. Class header: #ifndef CLIENT_DEBUGTEXT_H #define CLIENT_DEBUGTEXT_H #include <Map> #include <Math.h> #include <sstream> #include <SDL.h> #include <SDL_ttf.h> #include "vector2.h" using std::string; using std::stringstream; using std::map; using std::pair; using game::Vector2; namespace game { class DebugText { private: TTF_Font* debug_text_font; map<string, string>* debug_text_list; public: void SetDebugText(string var, bool value); void SetDebugText(string var, float value); void SetDebugText(string var, int value); void SetDebugText(string var, Vector2 value); void SetDebugText(string var, string value); int DrawDebugText(SDL_Surface*, SDL_Rect*); void InitDebugText(); void Clear(); }; } #endif Class source file: #include "debugtext.h" namespace game { // Copypasta function for handling the toString conversion template <class T> inline string to_string (const T& t) { stringstream ss (stringstream::in | stringstream::out); ss << t; return ss.str(); } // Initializes SDL_TTF and sets its font void DebugText::InitDebugText() { if(TTF_WasInit()) TTF_Quit(); TTF_Init(); debug_text_font = TTF_OpenFont("LiberationSans-Regular.ttf", 16); TTF_SetFontStyle(debug_text_font, TTF_STYLE_NORMAL); } // Iterates over the current debug_text_list and draws every element on the screen. // After drawing with SDL you need to get a rect specifying the area on the screen that was changed and tell SDL that this part of the screen needs to be updated. this is done in the game's Draw() function // This function sets rects_to_update to the new list of rects provided by all of the surfaces and returns the number of rects in the list. These two parameters are used in Draw() when calling on SDL_UpdateRects(), which takes an SDL_Rect* and a list length int DebugText::DrawDebugText(SDL_Surface* screen, SDL_Rect* rects_to_update) { if(debug_text_list == NULL) return 0; if(!TTF_WasInit()) InitDebugText(); rects_to_update = NULL; // Specifying the font color SDL_Color font_color = {0xff, 0x00, 0x00, 0x00}; // r, g, b, unused int row_count = 0; string line; // The iterator variable map<string, string>::iterator it; // Gets the iterator and iterates over it for(it = debug_text_list->begin(); it != debug_text_list->end(); it++) { // Takes the first value (the name of the variable) and the second value (the value of the parameter in string form) //---------THIS LINE GIVES ME SEGFAULTS----- line = it->first + ": " + it->second; //------------------------------------------ // Creates a surface with the text on it that in turn can be rendered to the screen itself later SDL_Surface* debug_surface = TTF_RenderText_Solid(debug_text_font, line.c_str(), font_color); if(debug_surface == NULL) { // A standard check for errors fprintf(stderr, "Error: %s", TTF_GetError()); return NULL; } else { // If SDL_TTF did its job right, then we now set a destination rect row_count++; SDL_Rect dstrect = {5, 5, 0, 0}; // x, y, w, h dstrect.x = 20; dstrect.y = 20*row_count; // Draws the surface with the text on it to the screen int res = SDL_BlitSurface(debug_surface,NULL,screen,&dstrect); if(res != 0) { //Just an error check fprintf(stderr, "Error: %s", SDL_GetError()); return NULL; } // Creates a new rect to specify the area that needs to be updated with SDL_Rect* new_rect_to_update = (SDL_Rect*) malloc(sizeof(SDL_Rect)); new_rect_to_update->h = debug_surface->h; new_rect_to_update->w = debug_surface->w; new_rect_to_update->x = dstrect.x; new_rect_to_update->y = dstrect.y; // Just freeing the surface since it isn't necessary anymore SDL_FreeSurface(debug_surface); // Creates a new list of rects with room for the new rect SDL_Rect* newtemp = (SDL_Rect*) malloc(row_count*sizeof(SDL_Rect)); // Copies the data from the old list of rects to the new one memcpy(newtemp, rects_to_update, (row_count-1)*sizeof(SDL_Rect)); // Adds the new rect to the new list newtemp[row_count-1] = *new_rect_to_update; // Frees the memory used by the old list free(rects_to_update); // And finally redirects the pointer to the old list to the new list rects_to_update = newtemp; newtemp = NULL; } } // When the entire map has been iterated over, return the number of lines that were drawn, ie. the number of rects in the returned rect list return row_count; } // The SetDebugText used by all the SetDebugText overloads // Takes two strings, inserts them into the map as a pair void DebugText::SetDebugText(string var, string value) { if (debug_text_list == NULL) { debug_text_list = new map<string, string>(); } debug_text_list->erase(var); debug_text_list->insert(pair<string, string>(var, value)); } // Writes the bool to a string and calls SetDebugText(string, string) void DebugText::SetDebugText(string var, bool value) { string result; if (value) result = "True"; else result = "False"; SetDebugText(var, result); } // Does the same thing, but uses to_string() to convert the float void DebugText::SetDebugText(string var, float value) { SetDebugText(var, to_string(value)); } // Same as above, but int void DebugText::SetDebugText(string var, int value) { SetDebugText(var, to_string(value)); } // Vector2 is a struct of my own making. It contains the two float vars x and y void DebugText::SetDebugText(string var, Vector2 value) { SetDebugText(var + ".x", to_string(value.x)); SetDebugText(var + ".y", to_string(value.y)); } // Empties the list. I don't actually use this in my code. Shame on me for writing something I don't use. void DebugText::Clear() { if(debug_text_list != NULL) debug_text_list->clear(); } }

    Read the article

  • Install windows xp from USB using the iso image

    - by buyrum
    I've got the windows xp ISO image on my computer and i want to install it on a computer without cdrom. The only way to do it is using usb flash drive. I don't know how to do it - i need to burn the iso to usb, make the usb bootable, install windows xp from the usb onto the hardrive (the usb should just replace the standard windows install disc). How to do it ?

    Read the article

  • Install windows xp from USB using the iso image

    - by buyrum
    I've got the windows xp ISO image on my computer and i want to install it on a computer without cdrom. The only way to do it is using usb flash drive. I don't know how to do it - i need to burn the iso to usb, make the usb bootable, install windows xp from the usb onto the hardrive (the usb should just replace the standard windows install disc). How to do it ?

    Read the article

  • Image Hosting for Website Backgrounds

    - by Luke
    Are there any websites which will allow me to put an image of a website background, for my website background, and will show me the internet link for where to find it, so it when I put it as the background of my website, it will show up.

    Read the article

  • image filter that spits out pi

    - by patrickinmpls
    I've seen this before but I forgot what's its called. Does anyone know of software that takes a picture and spits out an image of the number pi, ie. 3.14... not the symbol? It basically kinda looks like ascii art but the numbers are different shades of gray so it is like a black and white photo. Thanks!

    Read the article

  • How to mount a compressed ISO image?

    - by dma_k
    I have problem to mount a compressed (ISZ) image under Linux, which was created by e.g. UltraISO? I am aware about user-space fuseiso, but it fails to mount these images, as I have reported in Debian bugtracker (correct me if I ddi something wrong). I ask the community for a help: I need a proved solution to mount these images without decompressing them. I believe that CONFIG_ZISOFS kernel option cannot help, as it refers a special RockRidge extension (per-file compression with mkisofs -z or mkzftree).

    Read the article

< Previous Page | 25 26 27 28 29 30 31 32 33 34 35 36  | Next Page >