ComboBoxRenderer with image scaling

hi all,
I would like to know how to make the comboBoxRender with image scaling. Because my combo box is smaller than the image that I want to put inside..
currently, I "extends JLabel implements ListCellRenderer", but if I call setIcon to the Label, it is not scale to the combo size..., so I think is it need to extends another type of component ?
Could some of you give me a suggestion , better provide me a simple code.. Many Thanks for help.

Hi,
I've extended the Icon framework to support scaling. I never tried it with cell renderers, but maybe it works:
Extend JXIconLabel, set the zoomingStrategy to FullZooming.RESPECTING_ASPECT_RATIO_INSTANCE and set the XIcon (eg. a XImageIcon).
Maybe it works. (The library is open source.)
http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/JXIconLabel.html
Homepage:
http://www.softsmithy.org
Download:
http://sourceforge.net/project/showfiles.php?group_id=64833
Source:
http://sourceforge.net/svn/?group_id=64833
http://softsmithy.svn.sourceforge.net/viewvc/softsmithy/trunk/lib/src/org/softsmithy/lib/
API:
http://softsmithy.sourceforge.net/lib/docs/api/index.html
If you have questions just ask me!
-Puce

Similar Messages

  • Problems with image scaling

    I'm facing a real problem with image scaling
    I've used several algorithms but it all has defects but the most common thing is the out of memory error after several enlargments...
    does any one know a solution...
    note:
    I've used several packages to do so,but I'm looking for a solution from the jdk itself
    JAlexscorpio

    Did you take into account that the getScaledInstance() -method creates a completly new Image?
    So if you use it like in
    ImageIcon icon1=new ImageIcon("Blah.gif");
    ImageIcon icon2=new ImageIcon(icon1.getImage().getScaledInstance(400,400,SCALE_FAST);
    you will end up with 2 different Images which have their own data and memory requirements.
    even if you use something like
    ImageIcon icon1=new ImageIcon("Blah.gif");
    Image i=icon1.getImage();
    icon1.setImage(i.getScaledInstance(200,200,SCALE_FAST));
    You will need enough memory to store the data for the original image, as well as the data for the scaled
    version of the image, at least for the time that it take the JRE to create the scaled version. You never know when the garbage collector kicks in to delete you old data so it could be that this takes some time and until
    that moment your memory is not available. If your now doing several of the scaling operations, and there is no chance for the garbage collector to do its work, you will run out of memory.
    I hope that might help, if not feel free to post again

  • Strange problem with image scaling when placed

    I'm currently running InDesign CS6 from the Creative Cloud, and it's version 8.0. I have a PC and am running Windows 8.
    I am experiencing a really odd problem when placing images, and it only recently (within the last two weeks perhaps?) has developed. I do ebook production for a publisher. I have an InDesign template (INDD file really, but "blank" and ready to be filled in, and as such I refer to it as a "template") that I use, and the cover for the book goes on the first page. The document is set to pixels as the ruler measurement, and the pages are 650 pixels wide by 800 pixels tall. The margins are all set at zero. The cover images are sent to me as JPEGs and always have the same size: 72dpi setting and 500 pixels wide by 750 pixels tall. This is chosen to be about the size of the full screen on most ereaders, or close enough to be so.
    So when working on a new book, I put my cursor in the blank line that is set up to take the cover as an inline image. I do control-D to place, select the file, and hit enter. This SHOULD place an image at that location that is 500 pixels wide and 750 pixels tall when looking at the InDesign page rulers. Instead, InDesign insists on placing this image at 50% scaling, so that it is only 250 pixels wide by 375 pixels tall. And in the link info panel, it shows the actual PPI as 72 and the effective PPI as 144. It does this no matter how many preference changes I try (including the ones under file handling and the import setting options).
    The strangest part is that if the file is just a tiny bit different than 500x750 @72dpi, then there is no problem. For example, if I open the JPEG in Photoshop and change the image settings to 500x750 @73dpi, then InDesign places it at 100% scale like I want. If I change the image to 499x749 @72dpi it also gets placed in InDesign at 100% scaling. I've tried this with various new INDD documents with settings in pixels, inches, or picas as the ruler amounts, and with different page or margin sizes (just in case the problem is with my template). I get the same result no matter what.
    It appears that InDesign somehow thinks that any image that is exactly 500x750 @72dpi should be scaled at 50% when placing it into an InDesign file. Has anyone else run across this? Is it a bug or something I'm doing wrong? I've been doing this exact procedure for over a year, first with CS5 and now CS6, and I've never had this happen until just recently. I suppose it COULD be an accidental change in settings or preferences. But if it is, I cannot figure out how to change it back.
    UPDATE: I installed the 8.0.1 update and it did not resolve the issue. I also tried more image options. It looks like this scaling to 50% upon placing ONLY happens when all three attributes match this: 500x750@72dpi. All of the following modifications to the exact same image placed in the exact same spot in the exact same document resolved the issue:
    501x750@72dpi
    499x750@72dpi
    500x751@72dpi
    500x749@72dpi
    500x750@71dpi
    500x750@73dpi
    But of course, I don't want to have to modify every cover image I'm sent in order to prevent this scaling issue.

    I just tried this and got the same results (CS6, 8.0.1, on WinXP SP3). One other tidbit: the same 500px × 750 px @ 72ppi image saved as TIFF instead of JPEG worked correctly (at least for me). I haven't tried any other image formats yet.
    This sounds like a good candidate for an official bug report: http://www.adobe.com/cfusion/mmform/index.cfm?name=wishform
    -Bill

  • Acrobat X problem with image scaling in Excel

    We are using Acrobat X standard with Excel 2007.
    The problem is that when using the Create PDF button on the Acrobat toolbar within Excel, if the document has been scaled using Page Layout-Scale option within Excel, the resulting PDF has the image the correct size, but it has not been scaled. So the dimensions are correct, but only half of the image will be visible.
    To see what I mean, in Excel, add a picture, then choose Page Layout-Scaling and set to e.g. 50%. Check the print preview to see how it should look, and make sure you have a real printer selected in File-Print (NOT Adobe PDF printer). Then create PDF using the toolbar button. The image in the PDF will be wrong.
    This works fine if using native PDF converter (e.g. Save As PDF file) or by printing to the PDF printer, or by using the CreatePDF button when the Adobe PDF printer is selected as default in the print options.
    This seems to be a bug in X as in 9 it worked fine.
    Is there a solution to this?
    Thanks

    I should add, I updated to 10.1 and it did not resolve the issue.

  • Problem with image scaling

    I'm currently writing a flex application where I'm scaling
    images on a hidden canvas, and then taking a bitmap of them and
    drawing that bitmap to a visible component. There are two reasons
    for this: so that the user doesn't see a mixture of scaled and
    unscaled images, and so that I can do some operations on the
    bitmap, saving the processing time of altering all of the objects.
    The problem is that the scaling doesn't seem to have finished
    by the time I create the bitmap. Is there a way that I can be sure
    the operation has finished first? Or is there a better way I should
    be going about this?

    Although I didn't see an event for scaleX and scaleY, width
    and height do have an associated event (ResizeEvent), so I decided
    to use them for my scaling. I set up an event listener, and counted
    the events that had been fired, until they had been fired for each
    of the items that was to be scaled.
    I checked to see whether it worked, and it seemed not to
    have. In fact, it seems to have given me the same result as I had
    without the event listener, so as far as I can tell, the event is
    being called at the beginning of the resize rather than when it is
    completed.
    The problem isn't due to bad placement or sizing logic, as
    I've tested making the buffer visible, and it responds as expected,
    albeit with the resize flicker that I'm trying to eliminate. I am
    also certain that the draw is being triggered in the event
    listener, and have tested to make sure that there are no further
    resize events that I am not handling.
    I'm honestly kind of baffled. How can I resize multiple
    interconnected pieces of content without a separation being visible
    to the user in the intervening frames?
    Edit: I was able to tell when the image loaded by attaching a
    listener to the image that listened for the update event. I may be
    coming at this from the wrong angle, though, so I'm going to look
    into other ways to solve this problem as a whole.

  • Problem with image scaling and aligning to the MC bounds

    HI
    I have problem with my custom class.
    For example if image is loaded into the
    holder_mc inside of
    loader_mc, and if the loaded image is bigger than the
    loader_mc, then I want it to scale it down to match
    loader_mc bounds.
    It is something similar to Loader class...
    I've copied this code outside of Loader.as file and modifyed
    it, but its not working...
    I'd realy appreciate that if you could find any mistake or
    any code similar to this...
    Thanks in advance and sorry for my bad english...
    mloncaric

    Anyone please?:(

  • PS Newb needs help with image scaling and multi-sheet printout

    Hi, I'm trying to use PS CS3 to scale up an image I have so I can print it out to use as a map for a miniatures game.  I have no problem scaling the image to the appropriate size, but I can't figure out how to print out the image on multiple 8.5 x 11 sheets.  I had thought I'd seen an option for such a procedure previously, but maybe it was in another editing program.  If anyone has any ideas on how I might accomplish this I'd really appreciate hearing about them.  Thanks!

    Illustrator and InDesign do tiled printing as does CorelDraw. Photoshop as such does not, but some script for that may exist. In your case, the simplest solution would be to save the File as a PDF and have Acrobat generate a tiled print (Page Scaling setting in teh Acro print dialog). You just need to make sure your page properly fits multiple pages. Unliek AI and ID, Acro can only chop up stuff based on standard paper sizes...
    Mylenium

  • VI Method "Front Panel:Get Image Scaled" Memory Error 17

    Hi all, I've got two almost identical sub vi front panels that I'm dumping to a jpg image for reporting purposes.  One was copied and slightly modified from the other to show a different data set and plot.  The original works just fine, but the second sub vi, when using the "Front Panel:Get Image Scaled" method to pass the image to write the jpg, always returns the following error:
    "Error 17 occurred at Invoke Node in Myprogram
    Possible reason(s):
    LabVIEW:  Not enough memory to manipulate image.
    =============================
    NI-488:  Unrecognized command.
    Method Name: Front Panel:Get Image Scaled
    [Continue] [Stop]  "
    I've stripped the problem section into a simple tiny new that only opens the report and tries to get the image with the same working/non-working result above.  Using the Execution Trace Highlighter, it error is definitely occuring when the Method executes.
    Any ideas?  Thanks.

    Hey cjgpr,
        I haven't been able to dig up much info on this error message.  There's one other discussion forum post that talked about it some, and a KnowledgeBase article on it.  It seems that whatever changes you made to the front panel have caused it to exceed your computer's memory when creating an image.  Try removing items until it works, then see what actually breaks the functionality.
    Brian B
    Field Sales Engineer
    Tennessee/Southern Kentucky
    National Instruments

  • Image scaling changes

    Before I started here, the team was using FrameMaker 8 and migrating to FM 10. During the migration, we noticed that images in the documents we opened, converting them to FM10, had their image scaling data changed.
    Typically, we acquire screen shots using the highest resolution screen supported - mine is currently set at 1440 x 900. We scale the images to a width of 510 pixels (optimally) but no more than 600 pixels in our screen capture utility. We save the screen shots as Grayscale JPEGs. This process has, historically, provided images that fit our text column flow perfectly.
    In previous versions of FM, the images imported by reference appeared as 100% scaling in the FM image properties. Now, they appear as 75% scaling. We're wondering why and if there is any effects we need to be aware of in terms of PDF and HTML Help file sizes.
    While testing the import process, looking to see if the FM scaling data affected the image size, we saw that the pixel dimensions given by SnagIt varied wildly from the pixel dimensions given by FM. For example, the SnagIt dimensions for one image indicated it was 505x493 pixels whereas FM gave the dimensions of the source file as 507x315 pixels. Both are, as far as I know, giving me the source file dimensions but they are different.
    We might not have noticed this, the images looked okay, but we were carefully going through the transition to FM10 and looking at every detail.
    Question: why is FM10 auto-scaling the images to 75%?
    Question: does this scaling do anything to our output that we need to be aware of?
    Question: why do we get two different dimension data from the two software packages?
    Thanks,
    Wanda

    We  save the screen shots as Grayscale JPEGs.
    Are the screen images contone (e.g. real-world photos, CGI imagery),
    or flat (e.g. dialogs, line art)? JPEG uses curve-matching compression,
    which is great for tones that vary smoothly, but introduces nasty ringing
    edge artifacts on sharp edges of flat tones.
    TIF(zip), uses repeat-count compression, and is both non-destructive to flat
    tone images, and often compresses them more efficiently. We use EPS
    for the import format (no compression) and let Distiller or Acrobat post
    determine the compression to use.
    This process has,  historically, provided images that fit our text column
    flow perfectly.In  previous versions of FM, ...
    What is the target delivery format?
    ... the images imported by reference appeared as  100% scaling in
    the FM image properties. Now, they appear as 75%  scaling.
    In case you want to try it, I have never seen imported EPS objects
    change size when migrating a document to a later rev of FM.
    We import using 96 dpi.
    If the target is PC screen display at 100% page size, that's probably a
    decent target. PC screen resolutions today probably range from 80 to
    110 dpi, and I'd guess that 96 is very close to the sweet spot.
    We use (and I favor) bringing in all contone content at 200 dpi or
    higher. We bring bitmap (bi-level line art) in at 600. But then our
    target media is 600 dpi B&W bitmap on paper. However, we like
    to give web readers of the PDFs reasonable detail in images.
    Apple's "Retina" crusade is trying to move the industry to 300 dpi
    displays. I'd be happy with 200.

  • How to deal with images when detecting/resizing screen?

    Hi there,
    I am trying to learn how to detect screen resolution and
    resize a flash movie to those dimensions. The one thing I'm
    wondering first is, how to deal with images in the movie.
    Do I need a variety of different movie sizes that I serve up
    depending on the resolution, or is there some way of linking to
    higher rez image that can be scaled down to fit the screen?
    Thanks!

    as far as I know this has always been a bit of an issue when
    using
    images inside a scaled movie. If you display a high res image
    inside a
    scaled down movie, flash can't "reoptimize" it so the image
    looks
    jagged. Of course the other way around is even worse..
    Serving images based on the screen res could be possible if
    you detect
    it using javascript but could be a night mare to maintain and
    test it...
    I guess the questions I would ask myselkf are:
    1. what is my audience? What resolution the majority of them
    will have?
    2. Is there anyway I can keep the image size fixed, and scale
    to fit he
    rest of the design?
    3. How much time do I have to implement the customized
    version?
    It really depends on your project..but to answer to your
    quuestion yes
    you can detect.
    http://www.pageresource.com/jscript/jscreen.htm
    and your flash will have to interpret and load images from
    different
    directories based on the var passed

  • Error 53 : BD.Get Image Scaled

    Hi,
    I used invoke node(method block diagram:get image scaled) to get a screenshot of block diagram of a VI. It works well in LabView 8.6. But with the application built based on the VI, I got a 53 error code. Any suggestion?

    >>"Built" as in built into an .exe file?
    >>
    >>If
    so, you can't get an image of the block diagram because the block
    diagram is removed from the VI's when they are built into the
    executable.  The only thing present is any needed front panels, and the
    underlying compiled code that is built from the block diagram.
    >>
    >>For what reason do you want to capture an image of the block diagram?
    1. Yes, it is a .exx file.
    2. The application is used to generate screenshot of a user specified VI, not a VI built into the executable.

  • JPEG Image Scaling Speed

    I've got an application where I'm drawing images to the display from a TCP/IP stream. I'm unable to acheive much better than 8 or 9 fps and the real CPU consuming task seems to be the JPEG image scaling. The frames are being scaled by about 2x but the same color depth is retained. I'm running this application on a dual, 1 Ghz PIII with Red Hat 7.1 and JDK 1.3.1. Any suggestions on how to enhance the performance of Java's image scaling would be appreciated.

    You could try using bufferedImages and doing the scaling yourself. I can re-draw a bufferedImage by altering it's raster data
    ie..
    byte [] data = bi.getData().getDataBuffer().getData();
    I get up to 100 fps edditing a 640x480 area. You will have to account for things like bit depth yourself, and scaling algo's, but it might be worth it.
    Also check the Bug database, I believe your problem MAY be related to a bug where scaling always converts the entire image to format -> RGBA -> scaled format.

  • SHAKE: Image Scaling

    http://tech-algorithm.com/articles/trilinear-interpolation-image-scaling/
    I am trying to scale an image with the above mentioned technique but cannot seem to find the best way to combine the images at the end of the process.  Anybody have any ideas?

    http://tech-algorithm.com/articles/trilinear-interpolation-image-scaling/
    I am trying to scale an image with the above mentioned technique but cannot seem to find the best way to combine the images at the end of the process.  Anybody have any ideas?

  • I want to make a slideshow to view on my television with image's duration ranging from seconds to an hour or more and I want to use my iPhone or iPad mini to control the television through my Apple tv.  I've been unable to locate an app that will do this.

    I want to make a slideshow to view on my television with image's duration ranging from seconds to an hour or more and I want to use my iPhone or iPad mini to control the television through my Apple tv.
    I've been unable to locate an app that will do this.  The Photos app that comes with the phone or iPad has extremely limited duration controls.  PhotoStream seems to load everything from my phone or iPad not allowing me to just load up a set group of images.
    iPhoto for iPad is getting some terrible recent reviews.  I tried a couple other free apps but they don't use Airplay.
    I can do something like this with iPhoto and my MB Air, but it's kind of ugly to have the computer open in order to connect by Airplay to my Apple TV.  I've thought the iPad or iPhone would be a lower profile controller.
    Am I out of luck?

    Thanks for your help.  Since I'm uninterested in loading all my photos (the only option) into photostream, I won't be able to use the settings in ATV.  I guess I'm just stuck with using iPhoto on my MB Air.  Thanks again.
    paul

  • WYSIWYG editor upload with images

    Hello, friends!
    I need help solving following problem:
    I need to create WYSIWYG editor, which just to enter text and image. Other options (like font-size, font-weight...) not need. Then when submit the form with richedit, all data in form with images must sent to server.
    1) images must upload
    2) text must content following: text <img="src=../image1.png"> text <img="src=../image2.png"> text
    or maybe all images must save as a blob data
    Help me, people!

    Is this an Oracle question?

Maybe you are looking for

  • How can i export my custom abap code from one SAP system to another

    is there a way to export my custom code to any other SAP system. not the same client or server. say for ex: i develop a code in my system remotely and want to provide the same for my client to export into their system. maybe same versions but diff sy

  • Free????????????? playbook offer

    hello guys, i woke up this morning and i received a call from Fedex GR and they told me that the playbook has arrived and it is waiting for me at the custom office in athens. OK i said. Then they told me that i have to pay to take it with me. It is a

  • Setting autoreply with powershell

    Hello, I need some assistance please.  I know how to Set- and Get-Mailboxautoreplyconfiguration.  What I need assistance with is, after a user leaves they will often set an out of office or auto reply message.  I am in need of a script that I can GET

  • HT2534 i can't find none in the payment options

    i can't find none in the payment options

  • How many backups are saved in iCloud?

    Hi, how many backups has my icloud account?. i want to recover an important note