Pb displaying image in a canva with jpg format

I have an applet that displays images in a canva by pushing buttons. It works very well with gif image but bad with jpg image.
Coincidence or not ? I don't know.
What I know that I use the same method painting jpg or gif image
(first changing image name then calling mycanva.validate() and mycanva.repaint() and of course mycanva paint method contains g.drawimage(myimage,0,0,200,200,this) )
With jpg image what happens is the image is not completly painted (sometime half painted, sometime less than half painted) and if I do reload the browser the image is very well displayed...
has someone an idea ?
many thanks

try your app on another computer and see if it does the same thing. I had a very similar problem and it turned out to be my video driver was not driving my video properly. I changed/updated the video driver and my problems were totally solved.

Similar Messages

  • How can I save an object Image in a file with .jpg or .gif format?

    Greetings
    I'm programming a Ray Tracer but now I need to know like save an object Image in a file with .jpg or .gif format. Could anyone help me, please? It's very important to me do this as soon as possible. Thanks.

    In 1.4 you have ImageIO available ... javax.imageio.ImageIO.write is the method to call.
    - David

  • How to decode a set of datas received from serial port and display image on a canvas based on CVI ?

    Hi !
    I have received a set of datas via rs232 and it contains picture messages. I have to decode the datas first and then display them on a canvas.
    I have known several functions that may be used . Such as
    int SetBitmapData (int bitmapID, int bytesPerRow, int pixelDepth, int colorTable[], unsigned char bits[], unsigned char mask[]);
    int CanvasDrawBitmap (int panelHandle, int controlID, int bitmapID, Rect sourceRectangle, Rect destinationRectangle);
     However,I don't know how to set the following parameters according to the actual pixel values and color values.
    int bytesPerRow, int pixelDepth, int colorTable[], unsigned char bits[], unsigned char mask[]
     What's more,I have no idea how to decode the datas.
    The  attachment is a incomplete project. I will be very appreciated if anyone could help me .
    Best regards.
    xiepei
    I wouldn't care success or failure,for I will only struggle ahead as long as I have been destined to the distance.
    Attachments:
    Decode and display image.zip ‏212 KB

    Well, things are getting a bit clearer now.
    1. Your image is actually 240x240 pixel (not 320x240 as you told before). The size of image data is 57600 bytes which corresponds to that frmat (I was puzzled by such a data size compared with larger image dimensions!)
    2. The image is a 8-bits-per-pixel one; this means that you must provide a color palette to create the bitmap
    3. You cannot simply copy image data into bitmap fields in CVI: CreateBitmap always produce an image with pixeldepth matched with display colour depth (normally 24 or 32 bpp)
    All that means that you must:
    1. Create the appropriate color palette with 256 colors: it may be a grayscale or color palette depending on camera characteristics. Grayscale palette can be found in my sample project, while sample colour palettes can be found here (here the description of a "standard" 8-bpp color palette)
    2. Create the bits array correctly dimensioned for the color depth of your monitor
    3. Get each pixel value from the camera, lookup in the color palette for the appropriate colour and create the RGB informations into the bits array in memory
    4. Display the bitmap on the canvas
    As a first step, I would configure my system for 256-color display setting, create a bitmap and simply copy image data into it: you should be able to get the correct image back to your screen.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • Strange display problem on the Internet with jpgs

    Hi,
    For some time now I have problems with jpgs on some Internet sites. They don't show up properly. But only on this MAC, every other computer is ok. Here is a screencap of what I see:
    http://www.renderosity.com/mod/forumpro/showthread.php?thread_id=2690530
    It happens only on specific websites but now it also happens on MY OWN website (http://www.patrickeischen.com)! I didn't change a thing on this page, it was ok 'til now.
    I use Firefox & Safari. Can anybody please help me?
    Message was edited by: Danielle Kamp

    Hi Danielle:
    Cant use the link to your screencap, -wants login info.
    What do the jpgs look like? Sometimes I get a small square and question mark on some webpages where images should show but I just fault the webpage, or internet. Sometimes a reload works.
    Sounds like a software glitch on your PM G5, Have you repaired permissions recently?
    -Robert

  • Display Image imported from Access with Migration WorkBench

    Hi,
    I've imported a access database with migration workbench but can not display images aplying the same principals described in the sample appication.
    Maybe the formats are not compatible !?
    Any suggestions?!
    Thanks

    What version of Access do you have?
    What Access datatype are your images stored in?
    Did you accept the default mappings?
    Waht format are your images?
    Have you tried migrating the sample Access Northwind DB. Does this application show the images post migration?

  • Can a display image field be changed with javascript

    I have a select list (P3_RECON_CONDITION). when it changes It triggers javascript..
    in that javascript I would like it to change a Display Image field (P3_RECON_COLOR) without having to refresh the whole page..
    P3_RECON_COLOR is a Display image filed that gets its image from a blob from SQL:
    select color from projstat.condition_color, projstat.project where condition_color.condition = nvl(:P3_RECON_CONDITION,'W') and project.job_piece = :P3_JOB_PIECE
    the display field works now, but only for what the P3_RECON_CONDITION is when the page is loaded..

    yes, I tried that, but couldn't figure out how to do the: " dynamic action refresh the item P3_RECON_COLOR"
    I have
    Event: Change
    Selection Type: Item
    Item: P3_RECON_CONDITION (the select list)
    no condition
    TRUE ACTION: Refresh
    Fire when True:
    Selection Type: Item
    Item: P3_RECON_COLOR (the display image)
    (if I change the action to submit page.. it does fire.. but the refresh item does nothing..)

  • Using IMAQReadFile with .jpg format of file is producing an "incompatible image size" error ?

    The .jpg monochrome images are of slightly different sizes. Is there a way round this or should i use a different file format ?
    Attachments:
    Read_multiple_IMAQ_Image_and_other_data_from_file_and_loop_through.vi ‏88 KB

    I trimmed down your code a bit, but I don't see any problems with using various sized images. I ran your code first with no changes except removing the text file IO and changing the paths and saw no problems. I am using LV 6.1 with Vision 6.1. Take a look at the code below and see if it works for you.
    Regards,
    Brent R.
    Applications Engineer
    National Instruments
    Attachments:
    fileread.zip ‏309 KB

  • Display text file in servlet with preserved formatting(newlines, etc)

    how do i display a text file in servlet, but all the blanks and newlines are preserved.
    this is what i did:
    RandomAccessFile text = new RandomAccessFile("D:/FYP/tempMessage.txt","r");
    long length = text.length();
    byte[] bytes = new byte[(int)length];
    //Read in the bytes
    int offset = 0;
    int numRead = 0;
    while (offset < bytes.length
    && (numRead=deCiphered.read(bytes, offset, bytes.length-offset)) >= 0) {
    offset += numRead;
    // Close the input stream and return bytes
    text.close();
    String plainText=new String(bytes);
    //display in servlet
    pw.println("<center>Plain text: " + plainText + "</center>");
    the problem here is the newlines are seem to be omitted when they're displayed in a web browser, rendering the displayed text in a mess.
    any help are greatly appreciated. thanks in advance :)

    display text in between <pre></pre> tags.
    or display it inside a text area,dont worry abt the text area border, u can change that using style sheets.

  • Can you convert a folio created with jpg format to pdf format?

    I want to see pinch and zoom on some of the pages and it looks like I can't mix up pdf articles with pngs unless "automatic" knows the difference.

    If you are building a Single Edition publication you can read http://www.adobe.com/devnet/digitalpublishingsuite/articles/building-multi-rendition-artic les.html for details on how to use a single set of assets for both low and high resolution iPads.
    Neil

  • Mail 7.3 (1878.6) not displaying images in random messages.

    In the last couple of weeks, I've noticed that, with no preference changes made by me, that random messages are not displaying images only empty boxes with the small blue question-mark box in the middle. This is almost exclusively from companies and organizations that I'm interested in.
    I've made no changes with regard to messages downloading with my mail in Mail's preferences. If I had, I'd think that ALL such messages would behave the same.

    Nothing happens. Loading remote content is a Mail preference for me for everything. Best I can do is choose to click the "if your having trouble seeing this..." offered by many advertisers to take you to their site.
    Since it's random, I wonder if it's not something that has to do with those specific servers sending those messages. And it's only a few, but enough to be annoying. These are people I've received perfect content from for years in some cases. No changes have been made to my preferences.

  • Display image on jsp page

    I have to display image on jsp page with some text output. This image is already saved at a location parallel to web-inf and is generated dynamically using a servlet. I have used img tag html to display the image. Other outputs are taking their values from database.
    First problem is that image will be taking time to display in comparision of other outouts from database. I have to refresh the page to get imageon my page.
    Second is that if I save image in a folder parallel to web-inf in my project then it will not be displaying the image.
    Can I use any jsp functionality to display image with other outputs from database. I have used "*include*". but it shows only that image and other outputs.

    Best way is to use a servlet for this.
    <img src="path/to/imageservlet?id=someidentifier">
    <!-- or -->
    <img src="path/to/imageservlet/someidentifier">In the servlet's doGet() just write code which gets an InputStream of the image (either directly generated, or just read from the local disk file system, if necessary with help of ServletContext#getRealPath(), or even from the DB by ResultSet#getBinaryStream()) and writes it to the OutputStream of the response. That's basically all. Don't forget to buffer the streams properly to speedup performance and to save memory.
    You can find here a basic example: [http://balusc.blogspot.com/2007/04/imageservlet.html].

  • Mail not displaying images

    Hi...
    I have a strange new problem with Mail. It is not displaying images in email newsletters that I receive, but just from one sender. This has only been the case for a couple of days. I actually make the email newsletter and send it out from a web-based program but I obviously send it to myself to test how it looks etc. There was a problem recently with the server that meant that the email newsletter did not display images (just a box with a ? inside) for most recipients but it always appeared fine to me. Now it's the other way around. All other recipients seem to be able to view the newsletters fine (including other Mac and Mail users) but not me!! I do not have any other problems with Mail except for the occasional crash. Any ideas please??
    Thanks....

    Is this helpful?
    I think so, it indicates to me that they have problems!
    This is why the hosting company say it must be a problem with my mail program only.
    Might be, but even different Macs on the same Network may have or get different DNS numbers, and the question mark means either an unknown Pic type,or the link to where it's stored isn't getting through.
    Might try putting these numbers in Network>TCP/IP>DNS Servers...
    208.67.222.222
    208.67.220.220
    They'll be slower since they're in the US, but interest to see if the Pic shows, or can be opened/downloaded then... you can erase them afterwaeds, or put yors back.

  • How can I make Firefox not-display images?

    About 20 years ago I could configure Mosaic to not-display images. I browse with lynx usually now, but have to use something else when I need Javascript. Sometimes I want to not-display images. I can't find a setting in Firefox for this.

    Note that you can control this via the <b>permissions.default.image</b> pref on the <b>about:config</b>
    The default is 1 to allow all images, a value of 2 will block images.
    *http://kb.mozillazine.org/permissions.default.image
    **1: Allow all images to load, regardless of origin. (Default)
    **2: Block all images from loading.
    **3: Prevent third-party images from loading.

  • Image capture and send with post

    Ok, like the title suggests, I have a lil paint function
    drawing on a canvas in flex 2. What I need is to get that image all
    captured and bundled up to send to asp.net VB. The site is here:
    we are UNLIMITED .com Click on
    start, then Draw, and you will get to play with that canvas. You
    can draw all day, different brush sizes, colors, and erase. I need
    a capture button there to get the image off the canvas into BYTE
    format. Mainly what i need help on is sending that byte array from
    flex to asp.net VB, and REALLY need help on catching that byte
    array in asp.net VB and getting it to the point i save save it to
    the server HDD via the file I/O. I have already been able to save
    XML docs to the HDD with asp.net VB to be read by flex via the file
    I/O. I really just need some asp.net vb code to do the "POST" catch
    (or request), and get the image to PNG? format to be saved. This is
    going to be a small paint program in flex, members can use to
    create their avatar. I will be implementing say a crop, copy/paste,
    drag and drop, resize and what not, to give my users more
    flexability as far as what their image looks like. I'd really like
    it to be as close to a basic "windows paint" program. But that's
    another story. For some reason every time I look up passing
    variables from flex (flash) to asp.net vb, it's POSTing form vars,
    and really none of it has dealings with images. I know it's
    probably really the same, but like I was trying to say, I just get
    all kinds of confused with working with byte arrays and asp.net vb
    and flex. I was actually supposed to have this site up and running
    this past Aug, but with the swap to flex, the pains of membership
    between flex and asp.net vb, and my general newbie beginnings of
    this whole aspect of computers. Let's just say it's taken a bit
    longer than expected.
    So to recap from all my babbling:
    I need to:
    (flex)
    Capture the image on that canvas (see link)
    load to asp.net VB (pref. using POST)
    (asp.net VB)
    create an asp.net vb page to receive/request that image
    reformat that image ( pref. PNG )
    save the formatted image to the server HDD
    This should be fairly simple, and I'm almost embarrassed to
    ask for help. I've just been trying to work through this muck for
    way too long, and I really need to get past this.
    code snippets would be great, although just some good
    resources to look at would be great too. I do entirely appreciate
    any help in this matter.
    Daniel Keeney
    WebMaster
    we are UNLIMITED .com

    You've probably already worked this one out but I thought I
    would post my solution - not elegant but it works
    I spent two days trying to find an asp.net solution in VB.net
    to no avail so here goes:
    Actionscript:
    var bitMD:BitmapData = new BitmapData(this.width,this.height)
    bitMD.draw(this);
    var _PNG:ByteArray = PNGEncoder.encode(bitMD);
    var U:URLRequest = new URLRequest
    U.method = URLRequestMethod.POST
    U.data = _PNG;
    U.contentType="application/octet-stream";
    U.url = "
    http://localhost/CARTO/image.aspx";
    var UR:URLLoader = new URLLoader
    UR.dataFormat = URLLoaderDataFormat.TEXT
    UR.load(U);
    ASP.NET
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As
    System.EventArgs) Handles Me.Load
    Dim b() As Byte = Request.BinaryRead(Request.TotalBytes)
    Dim ms As MemoryStream = New MemoryStream(b)
    Dim img As System.Drawing.Image = Bitmap.FromStream(ms)
    Dim bmp As Bitmap = New Bitmap(img)
    Dim tempStream As New MemoryStream()
    bmp.Save(tempStream, System.Drawing.Imaging.ImageFormat.Png)
    Dim fs As New
    FileStream(System.Web.HttpContext.Current.Server.MapPath("test.png"),
    FileMode.Create)
    tempStream.WriteTo(fs)
    tempStream.Close()
    fs.Close()
    End Sub

  • Help with displaying image received from socket on Canvas

    Dear programmers
    I know that I'm pestering you lot for a lot of help but I just got one tiny problem which I just can't get over.
    I'm developing a remote desktop application which uses an applet as it's client and I need help in displaying the image.
    When a connection is made to the server, it continuously takes screenshots, converts them to jpg and then send them to the client applet via socket communication. I've got the the server doing this in a for(;;) loop and I've tested the communication and all seems to be working fine. However the applet is causing some issues such as displaying "loading applet" until I stop the server and then the 1st screenshot is displayed. Is there a way to modify the following code so that it displays the current image onto a canvas while the next image is being downloaded and then replace the original image with the one which has just been downloaded. All this needs to be done with as little flicker as possible.
    for(;;)
        filename = dis.readUTF();
        fileSize = dis.readInt();
        fileInBuffer = new byte[fileSize];
        dis.readFully(fileInBuffer, 0, fileSize-1);
        //Create an image from the byte array
        img = Toolkit.getDefaultToolkit().createImage(fileInBuffer);
        //Create a MyCanvas object and add the canvas to the applet
        canvas = new IRDPCanvas(img, this);
        canvas.addMouseListener(this);
        canvas.addKeyListener(this);
        add(canvas);
    }

    Anyone?

Maybe you are looking for