image scaling

Hello

I had some problems putting an image... used the code below, but no scaling happens someone at - it an idea of what I'm doing wrong?

QImage qImage = QImage::fromData(reply->readAll()).scaled(302,170,Qt::KeepAspectRatio);
        qDebug() << "QImage size width=" << qImage.width() << " height=" << qImage.height();
        bb::ImageData imageData(bb::PixelFormat::RGBA_Premultiplied, qImage.width(), qImage.height());

        unsigned char *dstLine = imageData.pixels();
        for (int y = 0; y < imageData.height(); y++)
        {
            unsigned char * dst = dstLine;
            for (int x = 0; x < imageData.width(); x++)
            {
                QRgb srcPixel = qImage.pixel(x, y);
                *dst++ = qRed(srcPixel);
                *dst++ = qGreen(srcPixel);
                *dst++ = qBlue(srcPixel);
                *dst++ = qAlpha(srcPixel);
            }
            dstLine += imageData.bytesPerLine();
        }

        Image image = Image(imageData);

NOTE:

-variable proofreading is the extracted data to a server

-l' retrieved from the server raw image is 16 x 9

-tried different proportions, but all gave the same result (no scaling observed)

Result:

no scaling at all when the image is displayed. but when I ask the size of QImage wide, it prints correctly 302 x 170.

too bad that... big ooops for my part.. in one of my files QML, the preferredHeight has been set at 100, and it was automatically reducing image in new QML

Tags: BlackBerry Developers

Similar Questions

  • Question about image scaling height

    Hi all

    I know that there are a ton of posts on this topic, but I have not really found one that is clear on the problem I encounter.

    Basically I have a PNG image that I want to change so that the width of the image corresponds to the width of the screen.  So, I want the height of the image to be adjusted automatically in order to preserve the proportions of the image.  Currently, I am doing this:

    Bitmap b = Bitmap.getBitmapResource(image);
    
    Bitmap scaled = new Bitmap(Display.getWidth(), ???);
    b.scaleInto(scaled, Bitmap.FILTER_BILINEAR, Bitmap.SCALE_TO_FIT);
    
    BitmapField bf = new BitmapField(scaled);
    

    But with this method, I have to set the height of the sized image.  This is not good, as I don't know what should be the height after the image has been resized (and kept proportions).

    Anyone know how I can determine the correct height of the image?

    Thank you.

    If you can get the height and width of the image, then use the ratios.

    UX = initial width, OH is original height, NW is the new width, NH = new height.

    (NW * OH) / OW = NH

  • Adobe Illustrator keep my exported JPEG image scaling! Help, please!

    Adobe Illustrator keep scaling of my artboard exported on a scale of 4,167. I select the artboard when I export JPEG image, but it keep the scale on the final result. Is there an option for this?

    Question.jpg

    because in photoshop pixels means pixels. in illustrator, they are a unit of measurement: identical to a point.

    you want a wide picture of 4 inches at 300 dpi, in this case? do your work plan at the physical size you what your final output to be (i.e. 4 x 3,333). export a 300 dpi JPEG. you will get a 1200 x 1000 px, 300 DPI JPEG.

  • Weakening of the image scaling on white background

    I do an animation intro for fotograaf maar with very large pictures inside 7948-4370. Adobe has no problem of scaling of the images of size 1920-1080.

    When I resize the vertical images, the white background appears on the right and left side. The I have problem when I size a vertical image 1080 size and zoom very slowly.

    When the images slowly expands, the right and left side of the picture begins to falter. The slowdown of the zoom, more it wobbles.

    This problem is occurring even after that I made my sequence. Is there a way to reduce it?

    I hope someone knows this problem and has a solution for me.

    Thank you very much!

    Export the video instead of capture using a screen capture utility. Use a preset for YouTube. Then, we might be able to see it better.

    Maybe it's the fact that you are scaling in full less than pixels. It is difficult to avoid in Premiere Pro, not as hard in After Effects.

  • Stacking of images scaling proportionately and keep their vertical distances

    Something that I've failed to understand in Muse, or find a solution online, is how to have a pile of images (proportionally) to scale with the width of the browser window, and once the window is reduced, they keep the same relative vertical distance.

    View 1 - correct

    Here, in the first GIF, you can see what I would do... Notice how everything is changing together.

    correct.gif

    2 - attempt failed

    That's what I've been able to achieve with Muse, using two blocks grey, filled with images to be filled proportionally. They are center-pin in the fill parameters, however high or low produced similar results, only the images of their respective anchor selections:

    incorrect.gif

    Advice on how to proceed would be greatly appreciated!

    I also tried to understand this using the preview of Muse compatible reagent, but not luck.

    Hi Alexander,.

    The site you're talking about depends on the readiness of your receptive.

    And if you call an image in a gray box and set it to be filled proportionally, it will adjust proportionately to the increase or reduction of the dimensions of this box, which is what we see in your example.

    For creating sensitive presentation with Muse, please visit: blogs.adobe.com/muse/2015/10/05/responsive-design-in-muse/

    Kind regards

    Akshay

  • RAW Image scaling

    When I load an image RAW 5376 x 3024 in PsCC, it automatically loads the image in RAW.  When you choose open, open the image in Ps on RAW, the image is reduced to 1000 x 563, I have to avoid this but all my cropping options are turned off and I'm at a loss of what it may be?

    Have you looked at the Workflow > Image Resizing options in the dialog box camera raw?

  • Loading an image works on Z10, but not on the Q5

    I use FilePicker to load an image from the library by using the following code

    Container {
            ...
    
            ImageView {
                id: imgView
                verticalAlignment: VerticalAlignment.Center
                horizontalAlignment: HorizontalAlignment.Center
                scalingMethod: ScalingMethod.AspectFit
                maxHeight: 250
                minHeight: 100
                bottomMargin: 30.0
    
            }
    
        }
        Container {
            verticalAlignment: VerticalAlignment.Bottom
            horizontalAlignment: HorizontalAlignment.Fill
            bottomPadding: 30.0
            leftPadding: 30
            rightPadding: 30
    
            Button {
                id: btnSelectImg
                topPadding: 25
                horizontalAlignment: HorizontalAlignment.Fill
                text: qsTr("Select Image") + Retranslate.onLocaleOrLanguageChanged
                onClicked: {
                    console.log("FilePicker")
                    picker.open()
                }
    
                attachedObjects: [
                    FilePicker { //image picker
                        id: picker
                        property string selectedFile
                        type: FileType.Picture
                        title: qsTr("Select Image") + Retranslate.onLocaleOrLanguageChanged
                        onFileSelected: {
                            imgView.imageSource = "file://" + selectedFiles[0];
                        }
    
                    }
                ]
            }
        }
    }
    

    Copy the following code to display the image correctly on Z10, but not on Q5 however both running the same version.

    No idea what could be the problem?

    It turns out that the problem is exactly as described by dbigham, ImageView can handle images up to a certain size depedning on the device.

    I added a C++ code to resize the image before feeding it to QML

    QML code:

    ImageView {
                id: imgView
                attachedObjects: [
                    ImageTracker {
                        id: imgViewTracker
    
                        onStateChanged: {
                            if (state == ResourceState.Loaded)
                            {
                                imgView.image = imgViewTracker.image
                                console.log("Shared image loaded correctly!")
                            }
                            else if (state == ResourceState.ErrorMemory)
                            {
                                console.log("Shared image load: Error Memory!")
                            }
                            else if (state == ResourceState.ErrorInvalidFormat || state == ResourceState.ErrorNotFound) {
                                console.log("Shared image load: " + state + "!")
                            }
                        }
                    },
                    FilePicker { //image picker
                        id: picker
                        property string selectedFile
                        type: FileType.Picture
                        title: qsTr("Select Image") + Retranslate.onLocaleOrLanguageChanged
                        onFileSelected: {
                            _app.loadImage(selectedFiles[0],300,200)
                            imgViewTracker.image = _app.image;
                        }
    
                    }
                ]
    
            }
    

    C++ code:

    void ApplicationUI::loadImage(QString strImageFileName, int width, int height)
     {
         QImage image;
    
         image.load(strImageFileName);
    
         image = image.scaled(width, height, Qt::KeepAspectRatioByExpanding);
    
         QImage swappedImage = image.rgbSwapped();
         if(swappedImage.format() != QImage::Format_RGB32) {
             swappedImage = swappedImage.convertToFormat(QImage::Format_RGB32);
         }
         const bb::ImageData imageData = bb::ImageData::fromPixels(swappedImage.bits(), bb::PixelFormat::RGBX, swappedImage.width(), swappedImage.height(), swappedImage.bytesPerLine());
    
         m_image = bb::cascades::Image(imageData);
         emit imageChanged();
     }
    
    QVariant ApplicationUI::image() const
     {
         return QVariant::fromValue(m_image);
     }
    

    C++ header:

    class ApplicationUI : public QObject
    {
    ...
    
    Q_PROPERTY(QVariant image READ image NOTIFY imageChanged)
    
    public:
    ...
    
    Q_INVOKABLE void loadImage(QString strImageFileName, int width, int height);
    
    signals:
    ...
    
    void imageChanged();
    
    private:
    ...
        QVariant image() const;
        bb::cascades::Image m_image;
    
  • Create a QImage bb::cascades:Image

    Hi, how can we create a QImage from bb::cascades:Image or bb::cascades:ImageData?

    Thank you

    Sorry to bring this element thead dead to life, but you can easily extract data from bb::ImageData using bb::utility:ImageConverter :

    bb::ImageData imageData; // our source imageDataQByteArray encoded = bb::utility::ImageConverter::encode("image/bmp", imageData);QImage image; // destination QImage
    
    if (image.loadFromData(encoded, "BMP")) { // load QImage from encoded QByteArray as BMP streamQImage scaledImage = image.scaled(720, 720, Qt::KeepAspectRatio); // if we wish to scale source image    scaledImage.save("sample.png", "PNG"); // if we wish to save scaled image}
    
  • How can I get a background image sensitive identical to the junction College Web site?

    Hello!

    I tried hard to figure out how to get the same effect that has College Junction - home - daily well-being all together . More specifically, the ability to resize the window of my browser and have scale of the background image to size without image quality loss. I have a 1920 x 1034 image. The width of my page is fixed to 800px. Then I fill an object with my image (suitable size) and apply the function of width of 100%. When I saw these settings in the browser, I'm able to resize the upper window of the page of 800px with desirable effect of the image scaled to fit the browser BUT the image loses quality (resolution).

    I bought the QooQee Widget: Smart 1.1 and I'm able to do a little bit reactive recess with her, but I have not found a way to create the same effect as the junctions of college. The best I can do is create an effect similar but end with gray side bars when I resize the browser to one size other than the proportions of the image. (see below)

    site iamge.PNG

    It was a little maddening for me. I have to do something wrong. Maybe my page properties were not correctly setup? Any help would be appreciated, thanks!

    More specifically, the ability to resize the window of my browser and have scale of the background image to size without image quality loss.

    There is no such thing, and there may be - for simple mathematical reasons. The web site that you referenced uses magical, just a very large image (oversized) that most of the browsers is not displayed to the maximum size one way or another. It's an illusion at low cost. The only other factor is the pixel, scaling the browser and in the case of Chrome algorithms, they are dependent on the GPU acceleration, so it's more likely something is wrong with that, if you really see the degradation.

    Mylenium

  • Why is my action of rotation scaling my work

    I am creating an action to rotate a layer. But when I play back the layer is also available on the smaller scale. I can see it in action where it shows the width and height as a percentage, but I can't understand how to change it. I tried double click this option in the action panel, but when I do that it plays to the action.

    Here are some screenshots...

    When I record the action here are the settings for the rotation:

    Screen Shot 2015-07-14 at 11.20.52 PM.png

    Then when I play action, that's what I see... an image scaling and the percentage in the Panel actions:

    Screen Shot 2015-07-14 at 11.21.20 PM.png

    How to create an action that doesn't turn and does not decrease the size? Thank you!!

    I just found a work around... I went to change, transform and decided to turn 180. Then I was able to double click on the rotate step angle in the action panel (I couldn't before). So I customized that rotation to the angle I want and there is no scaling not built in.

  • BLOB, the Image dimensions

    Hello, I created a region of Apex report using report region model. The requirement is to display pictures on the report. The query below shows photos, but question corresponds to the dimensions of the image, the sides appear even as the size of the uploaded image. Is it possible to see all these photos in a standard size (example: width 70px). SELECT the dbms_lob.getlength photo (picture), picture_mime_type, picture_filename, picture_character_set, kid_no, picture_last_updated FROM g_kid ORDER BY kid_no DESC; Oracle Database 11 g Express Edition Release 11.2.0.2.0 - Production Application Express 4.2.2.00.11 thank you in advance, best regards, FM

    It is easy to do for declarative BLOB images in reports using CSS. Add a style sheet in CSS Inline property page:

    td[headers="PICTURE"] img {
      display: block;
      width: 40px;
      border: 1px solid #999;
      padding: 4px;
      background: #f6f6f6;
    }
    

    where the PICTURE value in the attribute selector corresponds to the alias column in the image column. Define only a single dimension (in this case the width) will scale the image with the correct proportions. (Background, padding and border properties are just eye candy...)

    However, if the original images are large then scaling the in the browser in this way is a huge waste of bandwidth and produces lower quality images than to create good scaled down versions using image tools. Image download megapixel and then to reduce them to the size of the thumbnail result in needlessly pushing millions of bytes which will never be seen.

    For better performance and image quality, and where you need specific image scaling of the best approach is to use the ORDImage database objectto produce thumbnail and preview automatically versions. Note that this is not possible in Oracle XE as multimedia is not included.

  • How to make an image to look like pin but without actually PIN.

    I want image appear from left to right the browser (look like pins, but in fact not pinned)

    If I place a picture from the left of the browser in preview mode, I'll always see an empty space between the browser and the image on the left. To reach it, I have to pin the image... but I don't want my image to be pinned because it will always be visible (static) when scrolling, and I don't want that.

    THESE IMAGES SHOW EXACTLY WHAT I WANT. THE PHOTO I USED IS THE SAME IN ALL OF THEM WITHOUT CHANGING ITS SCALE.

    q1.jpgq2.jpg

    q3.jpgq4.jpg

    Yes, it's fixed. Unfortunately I had this before finding the answer. FYI, the method is also applied to it. The pictures are no different. They are rec in which increasing the width requires filling (image) scaling.

  • How to create an item of the display of the Image with functions Apex?

    Hi everyone :)

    I'm working on the 4.1.1.00.23 Apex in an 11g database XE.

    I want to display an Image in a report, I can do this by using the ' + BLOB download Format mask + ", but the images displayed in the original format and I want to display the smaller.

    I read that you need to create a procedure, a SYNONYM and call them to the src of the img tag. as Zsuzsi Vadasz mentions here
    http://blog.hilandco.com/2010/05/How-to-show-BLOB-type-column-as-image.html

    But I remember that I was able to create items in reports with the functions of the Apex, I think they were APEX_ITEM package, so I want to know if there is a way to create the '+' display Image + element with a function of APEX.

    Thank you.

    Diego (SniperCat) wrote:

    I'm working on the 4.1.1.00.23 Apex in an 11g database XE.

    I want to display an Image in a report

    Always specify if "report" means the report standard or interactive.

    I can do this by using the ' + BLOB download Format mask + ", but the images displayed in the original format and I want to display the smaller.

    I read that you need to create a procedure, a SYNONYM and call them to the src of the img tag. as Zsuzsi Vadasz mentions here
    http://blog.hilandco.com/2010/05/How-to-show-BLOB-type-column-as-image.html

    This post was obsolete when it was written. Use the built-in support of BLOB.

    Resizing of the declarative BLOB images in reports is simple using CSS. Add a style sheet with:

    td[headers="PHOTO"] img {
      display: block;
      width: 40px;
      border: 1px solid #999;
      padding: 4px;
      background: #f6f6f6;
    }
    

    where the value of the PHOTO in the attribute selector is the ID of the image column table header. Define only a single dimension (in this case the width) will scale the image with the correct proportions. (Background, padding and border properties are just eye candy...)

    However, the scaling of the images in the browser in this way is a huge waste of bandwidth and product of lower quality images than to create good scaled down versions using image tools. Image download megapixel and then to reduce them to the size of the thumbnail result in needlessly pushing millions of bytes which will never be seen.

    For better performance and image quality, and where you need specific image scaling of the best approach is to use the ORDImage database object to produce thumbnail and preview automatically versions. Unfortunately, this is not possible in Oracle XE as multimedia is not included :-(.

  • How can I get 300 DPI on my final drawing?

    International poster competition requires 300 dpi image, scaled to the portrait of 27 "x 40". How to do this using Pages?

    Who's going to be a huge file.

    Simple math that makes a 8 100 x 12 000 pixel bitmap in any format they will accept.

    Are you sure you want to a bitmap of the entire poster or a pdf file that has all the images to a minimum of 300 dpi?

    Peter

  • color temperature

    I need to convert a thermal image scaling of colors (RGB). I could get it with IMAQ, but in particulare I spend pixel temperature dedicated to a color value. Can someone help me find the algorithm in labview please? Thank you.

    I found the algorithm of solution here:http://www.tannerhelland.com/4435/convert-temperature-rgb-algorithm-code/

    Thanks for your help, have a nice day.

Maybe you are looking for

  • XP home or pro on my p30?

    Is there someone who can give me some advice on whether to choose xp home or pro to my p30? It s a machine 2xP4 and I have heard that the House does not support dual processors. I find the shiny machine, but something tells me that I m not getting ma

  • Satellite P300D-12F shows blue screen by installing Win7

    HelloWhen I bought ths laptop, Windows Vista is already installed (32 bit Premium). Now, I bought Windows7 Prof I wanted to upgrade my system. But, is not possible. Because of the compatibility of professional and high quality of windows.That's why I

  • phone applications

    I tried to download apps on my IPad game, they went too my phone tho so I pluged phone into my laptop and do not know how to extract them then put in to the IPAD. How can I stop my flight my apps phone

  • No activation code by email for HP ePrint on Tablet and smartphone

    I downloaded the HP ePrint app on my Tablet and smartphone, but haven't received the activation e-mail.  I got all the other emails without problem and I'm connected to the internet.  How long does take to receive the activation code email?  I read a

  • Difficult to change default logon screensaver

    I created a custom for Windows Vista Business SP2 screen saver.  I want to put my screensaver to default logon to be my new custom screensaver.  So I did some research and discovered that by changing the registry key hkeyuser\.default\control panel\d