Scaling JPEGs to fit into picture control

Hallo NG,
I have a frontpanel with a fixed sized picture-control where I want to
display a JPEG-Image.
I use the ReadJPEG and DrawFlattenedPixmap to display. Now, if my JPEG is of
bigger size than my picture control, the rest of the image gets clipped.
How can I scale a JPEG image to fit it into the control. If the control and
the image have different aspect ratios, that's OK, I could scale it down
with fixed ratio, and leave parts of the control blank.
So again: How can I scale the images, is it possible with those two VIs
mentioned above or do I have to make it more low-level and complex ?
Oliver

A solution I prefer to use involves .NET and a GDI Resize, this method supports many file formats, and bit depths, and seems pretty quick when .NET can be used.
http://forums.ni.com/t5/LabVIEW/Net-image-resize-how-to-convert-to-format-labview-can-use/m-p/219902...
I used it in my quick drop show VIs, to scale VI icons to fill the window size.
https://decibel.ni.com/content/docs/DOC-31302
Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

Similar Messages

  • Move a jpeg image within a picture control

    I am having problems moving a jpeg image inside a picture control with my arrow buttons.
    any help would be great thanks
    Harold Timmis
    [email protected]
    Orlando,Fl
    *Kudos always welcome
    Solved!
    Go to Solution.
    Attachments:
    picfun.vi ‏17 KB
    ball.jpg ‏2 KB

    Hi Harold,
    Things are hooked up wrong....
    (Also, you don't really want to read the same file with each repeat. Once is enough! )
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    picfunMOD.vi ‏13 KB

  • PDA example: Reading a jpeg file into a picture control

    Hi
    Does anybody have a simple PDA example of how to read a .jpg file and show it in a picture control. The jpg examples I've found does not compile for PDA.

    Evan wrote in message news:<[email protected]>...
    > In LabVIEW for windows there are VIs to read in JPEGs, however the PDA
    > module does not support those VIs, so I do not believe there is a way
    > to display JPEGs.
    The hard way would be to write your own JPEG -> Bitmap / Array
    de-compression routine. You will probably find example (C++) code at
    the JPEG web site.
    http://www.jpeg.org/jpeg_about.html

  • Save content of picture control as .jpg into excel file?

    Is it possible to save the contents shown of a picture control as a jpeg file into an excel file along with other data? Is this possible without using ActiveX? If I have to use ActiveX how do I use this?
    Thanks

    Hello AndyBE,
    ActiveX is definitely going to be your best bet. I�ve attached an example that should meet your needs. Let me know if this works for you.
    Have a nice day!
    Robert Mortensen
    Applications Engineer
    National Instruments
    Robert Mortensen
    Software Engineer
    National Instruments
    Attachments:
    Picture_To_XL_(6i).vi ‏133 KB

  • How can I load a graphic in SOFFCONT1 into an SAP picture control?

    At my customer site, GOS attachments to PM notifications are stored in SOFFCONT1, so I can't use cl_bds_document_set to get a URL that I can pass to the load method of the SAP picture control.
    How can I load the actual graphic in SOFFCONT1 into an SAP picture control?
    Or do I have to configure IW22 so it stores in BDS content servers, not SOFFCONT1?
    If this is the case, how do configure IW22 so GOS knows to store attachments as BDS documents rather than in SOFFCONT1 ???
    Thanks
    djh

    This explains how to make sure your PC and bin documents are saved on your HTTP content server, instead of in the database:
    http://help.sap.com/saphelp_nw04/helpdata/en/c0/1aca5823ee11d3a2db00a0c943858e/content.htm

  • Some of the pictures I am trying to use don't quite fit into the pre-set frames... Is there a way to move just the photo with-in the frame so to use the best part of the picture?

    Some of the pictures I am trying to use in Idvd don't quite fit into the specified frame... Is there a way to just move the picture itself within the frame to use the best part of the pic... For example I'm trying to use a picture of my son..but his head gets cut off when I drag the picture into the place holder....

    When trying to troubleshoot my problem I discovered a forum that was saying certain NTFS drives work just fine
    Apple support says that an NTFS or exFAT drive cannot be used when connected to the AirPort Extreme.
    I suppose it is possible that someone might have been using some type of special software on the drive that might perform a "conversion", but without more details, it is hard to know.
    Note: ExFAT and NTFS formats aren't supported.
    http://support.apple.com/kb/HT2426

  • Insert Art into the Picture control using AGM and ADM

    Hello. I need to get selected art and display it on the User Interface Picture control. What I already did:
    void ASAPI my_inDrawProc( ADMItemRef item, ADMDrawerRef inDrawer) {
    AIArtHandle **artStore = NULL;
    long artCount = 0;
    AIRealRect bounds;
    sAIMatchingArt->GetSelectedArt(&artStore, &artCount );
    AIPathStyle m_style;
    AIDrawArtData drawData;
    const AIColorConvertOptions drawOptions;
    for (int a=0; a<artCount; a++)
    AIArtHandle my_artHandle = (*artStore)[a];
    sAIPathStyle->GetPathStyle(my_artHandle, &m_style);
    sAIPathStyle->SetPathStyle(my_artHandle, &m_style);
    // Insert to port data
    drawData.art = my_artHandle;
    sAIDrawArt->BeginDrawArt(&drawData, drawOptions, 1);
    sAIDrawArt->DrawArt(&drawData, drawOptions);
    sAIDrawArt->EndDrawArt(&drawData, drawOptions);
    What to do next? Please help

    I'm not familliar with the AiDrawArtSuite unfortunately, but another way you might consider doing it is to rasterize the art you want to display using the AIRasterize suite. This will give you back the raw image data that you can put into an ADMImage (and cache).

  • How can I make picture fit into screen

    There's a picture on the Internet that I want to print, but it's slightly too tall to fit into my screen. I've tried changing the resolution. I've also gone to Apple>System Preferences>Displays>Geometry, but nothing there does the job. If I could rotate the image 90 degrees, I believe I could get the ENTIRE image on my screen, but the Rotate button only makes the picture tilt slightly. The Height adjustment doesn't help, either.
    Is there a way to rotate the picture 90 degrees, or is there any other way get the picture to fit into my screen? Yes, I've also dragged (stretched-out) the picture as far as I could.

    There's a picture on the Internet that I want to
    print, but it's slightly too tall to fit into my
    screen...
    The answer to your question depends a several things.
    Changing the screen resolution or "geometry" does
    not change how something is printed. So is your
    question the right question. Are you trying to make
    it "fit into your screen"? Or are you trying to
    make it print on a single sheet of paper?
    NOTE: If the goal is to fit it on the screen, there
    are many ways you can do that. Maybe the easiest is
    to select Print in whatever program you are using to
    see the image. In the Print dialog window, click the
    Save as PDF... button. This will allow you to save
    the page printout as a PDF file. Double-clicking on
    the file should open it in Preview app. In Preview,
    you can adjust the "magnification" to make it all fit
    on your screen.
    Thanks for the almost instantaneous reply. I've copied it because it contains useful information that I might need in the future; for now, however, I somehow managed to stumble into a solution while waiting for a reply. Oh, now I realize where I had gone wrong, and why I was finally succesful. At first, I tried to copy the screen by using the COMMANDSHIFT4. And, as you know, when using this system, you can only print what is on the screen. Later, well, I'm already a little fuzzy on what I did, but I didn't use the "Screen Capture" method. Thanks, again.

  • How can I Manually Insert an Image into a Picture Control?

    Hi,
            I am able to insert an image programmatically into a picture control. But I want to insert an image into the picture control without any code that is manually. How can I Do that?
    Thanks in Advance
    Regars,
    Malleswari

    malli wrote:
    Hi,
            I am able to insert an image programmatically into a picture control. But I want to insert an image into the picture control without any code that is manually. How can I Do that?
    Thanks in Advance
    Regars,
    Malleswari
     You may also drag and drop a picture directly to your front panel. You can also use paint, or some other tools,  to copy a part of a picture and past it into your front panel. This actually works for the block diagram also. Se example 
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)
    Attachments:
    pic example.vi ‏157 KB

  • Loosing D300 Picture Control settings when importing RAW files into CS3!!

    Hi there...I would really appreciate some help!!
    I have recently bought a D300/Tamron 17-50mm f2.8 which I love, however, I'm getting increasingly frustrated by either my lack of knowledge or some form of compatibility issue between the D300 and CS3!!
    When importing I am loosing all the RAW Picture Control settings!! - e.g. If I shoot using Picture Control "Monochrome" CS3 rips out all of the settings and returns the RAW image back to the default camera settings!! It doesn't seem to be the D300 as Picture Control settings are retained when viewing the RAW images on the camera's screen.
    Camera: D300/firmware - default install
    Computer: MacBook Pro Intel 2.4Ghz/2Gb RAM | Operating System: OS X 10.5.4 (9E17) | Software: Abobe CS3 with CameraRAW 4.4.1 plugin (also tried beta 4.5 but to no avail!!)
    Thanks in advance!!

    I am trying to open a NEF file (RAW format) from my card with PhotoShop CS3 and it does not work. These photos were taken with a Nikon D300. A window appears and the message read as follows:
    "Could not complete your request because it is not the right kind of document"
    Could someone help me?
    I have searched the online material and I have not found a solution as of yet.
    I have no issues opening JPEGs taken with a D300 and I can open NEF files that were taken with a Nikon D200...
    I appreciate your help.

  • How to drag a file into a picture control in a runing VI?

    When the VI is runing, LabVIEW allows users to drag a file from windows explorer to the File path control to get the path. But how could I drag a file into a picture control to get some event?
    Since the Picture control will also used to reponse to some other events so put the a transparent file path control on top of it may be the last idea in my mind...
    Is there any other options??
    Thanks guys!

    In Dreamweaver CS4, whenever I try to drag a newly updated version of a swf file into a certain directory / folder in the Files panel of the Dreamweaver interface, the file simply gets placed under my website's root instead.
    You are dragging the file from OUTSIDE of DW (using Explorer/Finder) and dropping it within DW's FILES panel (I didn't think you could do that!)?  Or you are dragging it from within the FILES panel, but from outside your site (by choosing "Local Disk" from the drop list)?  I think what you are seeing is the best you will get with that procedure.  Try going to "Local Disk" and copy the file, then return to your site and paste it where you want it.

  • Will iPhone 3Gs fit into iPhone 3G cases?  Any difference in size/Controls?

    Will the iPhone 3Gs fit into iPhone 3G cases? Any difference in size/Controls?

    I purchased an incase slider before my 32 GB 3GS arrived. When I put the phone in it today, it was so incredibly tight that I almost couldn't get the phone back out of it. I called the incase company and they said that despite Apple's claims that the phones are identical it is possible that the 32 GB phone is slightly thicker and is causing problems with certain slider cases. Incase is nice enough to send me a replacement (even though I bought from apple store online) when they have verified that their cases fit the new phones. My previous iPhone was a 2G so I could not tell if the new case would have fit the 3G. I guess, try before you buy.

  • Inserting a small graphics in a picture control

    Does any one have an example code for inserting a small graphics/8 bit bmp file (15x15) in a relatively large (240x360) 8 bit jpeg image at known location in LabVIEW using Picture Control? Thanks in advance.

    Hello,
    To read an image file (BMP, JPG, PNG) and put it into a picture control you can use the OpenG function "draw image from file", and then use the picture control property "Zoom" to fit it correctly.
    Here's an example :
    You can get OpenG functions from here.
    Hope this helps.
    When my feet touch the ground each morning the devil thinks "bloody hell... He's up again!"

  • Can an image resize automatically to fit into a template?

    Many (weaker) programs allow you to drag an image into a template and have it resize to fit into a specific area.  Can this be done in CS6?  For instance .... if you designed a 4x6 Christmas card template and it had a (place holder?) for a 2x2 photograph, and you dragged an image into this 2x2 area, can it resize automatically to "fill" just that 2x2 area?  This would result in some cropping of just the longest dimension, if the image inserted wasn't a square.

    It can be done with Photoshop Scripting.   Note when the inage has a diffenebt aspect ratio or different shape then the template the images is sized to fit and fill the template open and any excess is masked off.
    I have a free download you can use.  In Photoshop version  CS2 through CS5 Below CS2 some required features are missing and there are bugs in CS6 scripting.
    Photo Collage Toolkit 
    Photoshop scripting is powerful and I believe this package demonstrates this. The package includes four simple rules to follow when making Photo Collage Template PSD files so they will be compatible with my Photoshop scripts.
    There are ten scripts in this package they provide the following functions:
    TestCollageTemplate.jsx - Used to test a Photo Collage Template while you are making it with Photoshop.
    CollageTemplateBuilder.jsx - Can build Templates compatible with this toolkit's scripts.
    LayerToAlphaChan.jsx - Used to convert a Prototype Image Layer stack into a template document.
    InteractivePopulateCollage.jsx - Used to interactively populate Any Photo Collage template. Offers most user control inserting pictures and text.
    ReplaceCollageImage.jsx - use to replace a populated collage image Smart Object layer with an other image correctly resized and positioned.
    ChangeTextSize.jsx - This script can be used to change Image stamps text size when the size used by the populating did not work well.
    PopulateCollageTemplate.jsx - Used to Automatically populate a Photo Collage template and leave the populated copy open in Photoshop.
    BatchOneImageCollage.jsx - Used to Automatically Batch Populate Collage templates that only have one image inserted. The Collage or Image may be stamped with text.
    BatchMultiImageCollage.jsx - Used to Automatically Batch Populate Any Photo Collage template with images in a source image folder. Easier to use than the interactive script. Saved collages can be tweaked.
    PasteImageRoll.jsx - Paste Images into a document to be print on roll paper.
    Documentation and Examples
    Download

  • Datagrid Scrolling Problem.. Does not fit into Parent Container..

    Hi All,
           I have a module and module contains only one datagrid. I am adding this module to tab navigator dynamically in the next index. I am using Text as Item renderer in the datagrid and the row height will change depending upon the data diplyed on the Text. When the data populate in datagrid the datagrid going beyond the containers layout. i.e height is not fit into parent container. I am using Canvas as parent container .. Please find the below attached pictures and you will get to know what is my problem?
    Please help me to get out from this issue.. It is urgent..

    Thanks for quick reply
                   Here I am adding this module to canvas and the canvas is also dynamic . As you said "customize the measure() method in Text control and return the correct measuredHeight based on the explicitWidth."  what is the relation between Text control height and datagrid? Datagird should take it's parent container width and heights.  I am newbie to this Flex.. can you please explain it briefly. And if you have any Other way to do this please tell me .. it is very helpful to me.. Can you please post cusomized measure method if possible. please

Maybe you are looking for