How to show a tif image

I want to show a tif in a JLabel
I know Java work with gif and jpeg, but what 's about tif ?

Well, you need a tiff decoder. AFAIK the new ImageIO API supports tiff, but if you're after something smaller I'm sure you'll find something useful from http://www.geocities.com/marcoschmidt.geo/java-image-coding.html

Similar Messages

  • How to load a tif image in flex

    Hi All,
    Is it possible to load a tif image in flex. If it's possible
    anyone guide me or send me some code snippets regarding how to
    display a tif image in flex.
    Regards,
    Dharma

    "flexdharma" <[email protected]> wrote in
    message
    news:ga2d96$p8h$[email protected]..
    >
    Hi All,
    > Is it possible to load a tif image in flex. If it's
    possible anyone guide
    > me or send me some code snippets regarding how to
    display a tif image in
    > flex.
    Convert it to the much more web-friendly png format.

  • How to show an Default Image in case of Image  src attribute is pointing to  null

    Hi ,
    I am displaying Images on to DataGrid by reading an XML File .
    This works fine if the Image src is prsent.
    Now my question is that sometimes the Image  src might be null , then in which case i need to
    display some default Image .
    <mx:HBox id="hBox">
    <mx:Image source="{rep.currentItem.@src}"/>
    </mx:HBox>
    <images>
    <image src="images/One.png" />
    <image src="images/Two.png"/>
    <image src=""/>
    </images>
    Please tell me as how to show an Default Image in case of Image  src attribute is null .
    Please share your ideas on this .
    Thanks in advance .

    bind the image source to a function
    <mx:Image source="{getImage()}"/>
    then write a function to detect if an image is present
    private function getImage():String
         if  ( rep.currentItem.@src == null)
              return "default.png";
         else
              return rep.currentItem.@src;

  • How to get a .tif image with n different colors?

    Hi..i want to know how can i get a .tif image colored by some colors. I want to do something like this:
    if(tifImage.pixel < 0.1) {
    tifImage.pixel = yellow;
    else if( 0.1 <= tifImage.pixel && tifImage.pixel <0.5){
    tifImage.pixel = red;
    up to n colors.
    I prove the next code, but it is not getting the colors i want.
    public void generateImage(BufferedImage bi,double alto,double medio,String output){
              int width = bi.getWidth(); // Dimensions of the image
              int height = bi.getHeight();
              // Some constant colors (as arrays of integers).
              int[] red = {255, 0, 0};
              int[] green = {  0,255,  0};
              //int[] blue = {  0,  0,255};
              int[] yellow = {255,255, 0};
              //int[] background = { 85, 85, 85};
              int[] background = { 255, 255, 255};
              // The original image data will be stored on this array.
              int[][][] imageData = new int[width][height][3];
              // We'll fill the array with a test pattern bars thingie.
              double[] pixelArray=null;
              for(int w=0;w<width;w++)
                   for(int h=0;h<height;h++)
                        if(bi.getRaster().getPixel(w,h,pixelArray)[0]>=9000){
                             //lo dejo blanco
                             imageData[w][h] = background;
                        else if(bi.getRaster().getPixel(w,h,pixelArray)[0]>=alto){
                             //lo dejo rojo
                             imageData[w][h] = red;
                        else if(bi.getRaster().getPixel(w,h,pixelArray)[0]>=medio){
                             //lo dejo amarillo
                             imageData[w][h] = yellow;
                        else{
                             //lo dejo verde
                             imageData[w][h] = green;
              // Now we have a color image in a three-dimensional array, where the
              // third dimension corresponds to the RGB components.
              // Convert the color image to a single array. First we allocate the
              // array.
              // Note that this array will have the pixel values composed on it, i.e.
              // each R,G and B components will yield a single int value.
              byte[] imageDataSingleArray = new byte[width*height*3];
              int count = 0;
              // It is important to have the height/width order here !
              for(int h=0;h<height;h++)
                   for(int w=0;w<width;w++)
                        // Rearrange the data in a single array. Note we revert RGB, I still don't
                        // know why.
                        imageDataSingleArray[count+0] = (byte)imageData[w][h][2];
                        imageDataSingleArray[count+1] = (byte)imageData[w][h][1];
                        imageDataSingleArray[count+2] = (byte)imageData[w][h][0];
                        count += 3;
              // Create a Data Buffer from the values on the single image array.
              DataBufferByte dbuffer = new DataBufferByte(imageDataSingleArray,width*height*3);
              // Create an pixel interleaved data sample model.
              SampleModel sampleModel =
                   RasterFactory.
                   createPixelInterleavedSampleModel(DataBuffer.TYPE_BYTE,
                             width,height,3);
              // Create a compatible ColorModel.
              ColorModel colorModel = PlanarImage.createColorModel(sampleModel);
              // Create a WritableRaster.
              WritableRaster raster = RasterFactory.createWritableRaster(sampleModel,dbuffer,new Point(0,0));
              // Create a TiledImage using the SampleModel.
              TiledImage tiledImage = new TiledImage(0,0,width,height,0,0,sampleModel,colorModel);
              // Set the data of the tiled image to be the raster.
              tiledImage.setData(raster);
              // Save the image on a file.
              JAI.create("filestore",tiledImage,output,"TIFF");
    Thanks

    I tried that. When I open one image and set the exposure, then go to open the second image, nothing happens. I then saved one image as a psd file, then it would let me open the raw file a second time. When I had both open on the same screen and dragged the layer from one into another image, the layer size ended up being different than the other file. It was shifted down and to the left. I need these images to be pixel locked, and the user experience I went through did not allow me to do this.
    I also do not see a way to copy/paste layers between files.

  • How to show a background image in the Forms 6i MDI window?

    Hello,
    We are using Oracle Forms 6i Release 2 Patch 18 on Windows XP in client/server environment (not web server).
    Is there any way to show a background image in the MDI root window without using DLL injection to subclass the MDI root window procedure.
    Kurt

    Please try this 
    Public Function Decompress(ByVal arr As Byte()) As Byte()
            Dim s As Byte()
            Dim notCompressed As Boolean
            notCompressed = False
            Dim MS As System.IO.MemoryStream
            MS = New System.IO.MemoryStream()
            MS.Write(arr, 0, arr.Length)
            MS.Position = 0
            Dim stream As System.IO.Compression.GZipStream
            stream = New System.IO.Compression.GZipStream(MS, System.IO.Compression.CompressionMode.Decompress)
            Dim temp As System.IO.MemoryStream
            temp = New System.IO.MemoryStream()
            Dim buffer As Byte() = New Byte(4096) {}
            While (True)
                Try
                    Dim read As Integer
                    read = stream.Read(buffer, 0, buffer.Length)
                    If (read <= 0) Then
                        Exit While
                    Else
                        temp.Write(buffer, 0, buffer.Length)
                    End If
                Catch ex As Exception
                    notCompressed = True
                    Exit While
                End Try
            End While
            If (notCompressed = True) Then
                stream.Close()
                Return temp.ToArray()
            Else
                Return temp.ToArray()
            End If
        End Function
    Thanks & Regards Manoj

  • How to show a compressed image in the report?

    Hi
    I have created a new report.what i do in application is i  compress the image and save it in database.now i need to retrieve the compressed image and display in the report. I have used the following code to decompress the binary data save in the image.I
    dont know after that what should i do. Please help me to show the picture in SSRS Report. I need to show picture in many reports.one of my doubt is how to call this function in SSRS Report. The function accepts input as byte but in database the column in varbinary.
    should i convert the input type of function to varbinary instead of byte array? Please help me.
    Public Function Decompress(ByVal arr As Byte()) As Byte()
    Dim notCompressed As Boolean
    notCompressed = False
    Dim MS As MemoryStream
    MS = New MemoryStream()
    MS.Write(arr, 0, arr.Length)
    MS.Position = 0
    Dim stream As GZipStream
    stream = New GZipStream(MS, CompressionMode.Decompress)
    Dim temp As MemoryStream
    temp = New MemoryStream()
    Dim buffer As Byte() = New Byte(4096) {}
    While (True)
    Try
    Dim read As Integer
    read = stream.Read(buffer, 0, buffer.Length)
    If (read <= 0) Then
    Exit While
    Else
    temp.Write(buffer, 0, buffer.Length)
    End If
    Catch ex As Exception
    notCompressed = True
    Exit While
    End Try
    End While
    If (notCompressed = True) Then
    stream.Close()
    Return temp.ToArray()
    Else
    Return temp.ToArray()
    End If
    End Function
    Thanks & Regards Manoj

    Please try this 
    Public Function Decompress(ByVal arr As Byte()) As Byte()
            Dim s As Byte()
            Dim notCompressed As Boolean
            notCompressed = False
            Dim MS As System.IO.MemoryStream
            MS = New System.IO.MemoryStream()
            MS.Write(arr, 0, arr.Length)
            MS.Position = 0
            Dim stream As System.IO.Compression.GZipStream
            stream = New System.IO.Compression.GZipStream(MS, System.IO.Compression.CompressionMode.Decompress)
            Dim temp As System.IO.MemoryStream
            temp = New System.IO.MemoryStream()
            Dim buffer As Byte() = New Byte(4096) {}
            While (True)
                Try
                    Dim read As Integer
                    read = stream.Read(buffer, 0, buffer.Length)
                    If (read <= 0) Then
                        Exit While
                    Else
                        temp.Write(buffer, 0, buffer.Length)
                    End If
                Catch ex As Exception
                    notCompressed = True
                    Exit While
                End Try
            End While
            If (notCompressed = True) Then
                stream.Close()
                Return temp.ToArray()
            Else
                Return temp.ToArray()
            End If
        End Function
    Thanks & Regards Manoj

  • How to show 'now playing' Image in bottom left, How to show 'now playing' Image in bottom left

    Hi,
    On my iTunes (10.7) in the bottom left corner it shows an image of the music you are currently playing titled as Now Playing.
    I am trying to get the same thing on my father's iTunes, his is also v10.7 but no 'now playing' section. How can I enable this? I can't seem to find it in the 'view' menu either..
    Thanks,
    Jamie

    Try clicking the wee icon I've circled in the following screenshot:

  • How do I stop .tif images being converted and compressed to .jpeg?

    I'm not sure what is going on here but when I add a high res .tif picture to iWeb it will display correctly until I publish the website.
    Once the website is published I the high res .tif picture suddenly becomes a low res .jpeg picture and looks ruddy awful.
    How do I stop iWeb from downscaling the resolution?
    Thanks

    Tiff files are notoriously large which is why it may not be supported - have you tried converting to PNG as this is also lossless and was developed for saving highly detailed images where loss of quality was unacceptable. PNG should be supported I have used them for transparent graphics. Also it may be because you put them in an image placement or album rather than straight on the page. Other than that I can't help. I use jpegs for ordinary images and haven't noticed too much loss of quality but it depends on the purpose of your site.
    You could always upload the image separately and make a link to the page in iweb, or embed in iframe, just doing some lateral thinking here.
    Experiment and see what happens, thats the fun of learning new things.

  • How do you color tif images??

    Yet, another issue with indesign.  Longtime PM user, I could bring in a tif, like a
    logo, and select any color and poof, done.  Now the same tif, in indesign, and I'm colorizing THE DREADED
    BOX, not the actual image?  I've tried deselecting, ungrouping, shift clicking, selecting the background, which I can't and the outline, which doesn't help.  There has to be an easy fix for this, I'm losing it!!!  What am I doing wrong?

    There´s difference between selecting image with black or white arrow. If you select 1-bit image with black arrow, you can target color to container (meaning frame), then you fill transparent areas with color. And if you use white arrow to select image, you can target color to visible pixels (those which are originally black when you place image)

  • How to show full size images from a thumbnail view?

    Hi,
    I am trying to setup a simple portfolio of projects. I have a series of 4 screen dumps of some web work I did, and they have to be greatly reduced in size so they can all fit on one page. I'd like to be able to have the user click on any of the 4 screen shots (imported png files) and then see a full size image. I know how to do this basically in plain html, but uncertain how to set this up with iWeb. Do I need to create 4 new pages with the full size images on them? Or is there an easier way.
    thx
    'mark

    mark:
    The method described on this demo page is one way you can accomplish what you want: Opening Item in a New, Precisely Sized Window.
    Another method can be seen here: Fancy Zoom.
    There are a number of flash based slideshows that might do what you want. Check out these:
    Jalbum
    SimpleViewer and Flash Album Exporter
    Mouse Over
    OT

  • Show a .tif image with ImageIcon?

    I'm using ImageIcon class to display images, but I have a tif formatted image. ImageIcon doesn't seem to support it. Is there a work around?

    Use the feedback link?

  • Showing .tif images on browser

    Hi
    Currently I am doing one module where in I have to show the tif images (.tif extension) on the browser through servlet. I was wondering if there are any Java API's which I can use to show them. I am using JSP on the front end.
    Thanx very much!
    -Asheesh

    Well we need to store them as tif only and on request from net display them. We can store them temp on server as gif / jpg and clean them on a nightly basis but the the aim is to do the coversion tif to gif / jpg format on the fly (request) and not covert all into gif / jpg and then display.
    Thanx!
    -Asheesh

  • Upload .TIF images in SE78

    Hi all,
    I've currently used SE78 to upload .BMP images for use in SmartForms. Now I want to upload a .TIF image, but under the "Graphics" folder in SE78 there is only a "BMAP" folder.
    How can I upload .TIF images in SE78/add a new folder for .TIF images?
    All helpful answers will be rewarded!
    - Mari Virik

    Hi,
    These are the steps to be followed for uploading graphics in R/3 system 
    1.   First save the file as BMP 
    2.   Open the BMP file in IMaging (Goto -> Programs -> Accessories -> Imaging) and 
          make it Zoom as 100% and save as *.TIFF 
    3.   Open SE38 and execute program RSTXLDMC
    4.   Give your TIFF file path name 
    5.   Select Bcol (for Color) 
    6.   TEXT ID will be ZHEX-MACRO-*. 
    7.   Inplace of * write your own logo name (ZCOMPANYLOGO) 
    8.   Execute the program

  • How do I show multiple rollover images on a page inserted dynamically (pulled out of a sql database

    How do I show multiple rollover images on a page inserted dynamically (pulled out of a sql database table) using Dreamweaver’s Repeat Region. Example: I have different products each one associated (through their productID) with two images (one that’s showing in the page and one for the rollover effect) that are pulled from a database using Dreamweaver’s Recordset. So I want to end up with a page containing row after row of images(one for every product).When moused over each image will reveal the second (rollover) image for the same product which in turn can be a link(the image itself ) that when clicked leads to a detailed page with more information about the product the image is associated with. To show row after row with images for the different products in the database table I am using Dreamweaver’s Insert Rollover Image command and then the  Repeat Region – I have no problem to complete the steps, to insert the image and the rollover one at once and set the paths so they are pulled dynamically depending on the productID they are associated with .I have also no problem to apply the Repeat Region so not only the first image associated with the first product in the table is shown but all of them-a routine and standard procedure when using the Repeat Region to dynamically generate and display multiple rows of data. However, when I preview the page the rollover effect is lost –the images are shown but when moused over the second  image does not  show. The problem is caused when the Repeat Region is applied-once again I am allowed to apply it but the rollover stops working, a kind of interference. ANY SOLLUTION PLEASE, ANY WORK AROUND.

    I gotta tell you, using multiple images for rollover effects is going to be a big challenge in your dynamic scenario. 
    If this were my product page, I would use thumbnails with a bit of CSS opacity or filters to desaturate and make them full opacity/color on mouse over.  Nice effect with much less bandwidth. Easily done globally with CSS code.
    Two examples:
    http://alt-web.com/GALLERY/GalleryTest.php
    http://alt-web.com/TEMPLATES/CSS-Semi-liq-photo-sheet.shtml
    Nancy O.

  • How do I set the image size in PS touch to print to my Epson printer w ithout losing any of the picture. PS Touch appears to be showing pixels and not inches, how can I covert it toshow inches?

    I am using PS Touch from my tablet . I am importinga photo from an SD card . When all editing is completed I then send it wireless from the tablet  via Epson I print to the printer. It all works great except that part of the photo at each end is cut off and does not print. I am printing on 8.5 x11 paper.
    How do I convert the image size in PSTouch frm pixels to inches?

    Epson's iPrint has always been an oddball. It will always "zoom in" on an image to print even if you have the proper dimensions and resolution set for actual print size. I think other users have reported this, at least on Android.
    You can't have PS Touch show inches instead of pixels at this time but you can use an online website to find out what you need to fit within a particular resolution. (Google "pixels to inches calculator".)

Maybe you are looking for

  • Drag and drop not working in WAD

    Hi All, I have created a web template with navigation panel item and analysis item.both items are assigned to one query.the query is showing the right values but when i am trying to drag and drop it is not working even when i try to filter(using filt

  • Column types on a flat file

    I am using a flat file as a target and when I define column types as anything other then string I get the following error on execution 000 : null : com.sunopsis.jdbc.driver.file.a.i com.sunopsis.jdbc.driver.file.a.i      at com.sunopsis.jdbc.driver.f

  • Handoff from OS X to iOS not working, iOS to OS X does work

    I have an iPhone 6 running iOS 8.1. I have a 2012 MBP w/ Retina Display with a clean install of OS X 10.10. Both devices are logged into the same iCloud account. Handoff has been enabled on both devices. I've used Handoff to make and answer phone cal

  • Quick question on JTextArea

    When i am using JTextArea, as it stands it is just a boring, plain white space. Is there any way of improving on this for instance adding a border to it?

  • Itunes Fehler -206?

    Beim Kauf von APP's kommt "unbekannter itunes-Fehler (-206)! Wie ist die Lösung?  Vielen Dank - Horschtle