Find the Best Demos and Examples

Check out this quick tour to find the best demos and examples for you, and to see how the Felgo SDK can help you to develop your next app or game!

Forums

OverviewFelgo 2 Support (Qt 5) › MultiResolutionImage and QtGraphicalEffects

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #13422

    spike

    Hi,

     

    how do these two work together? For example, applying a Glow effect on a MultiResolutionImage results in a “sd” version of the image. Means: It’s blurried and does not look nice. This is the same for any other effect I tried.

     

    MultiResolutionImage {
        id: img
        source: "qrc:/my/img.png"
    }
    
    Glow {
        id: img
        radius: 8
        samples: 17
        source: img
        anchors.fill: img
        color: "white"
    }

     

    Without the Glow, it loads the +hd2 version.

     

    #13423

    Alec
    #13430

    G√ľnther
    Felgo Team

    Thanks for stepping in Alec! ūüėČ
    Yes, I think this solution should also help in this case.

    Did you manage to fix the problem with that Spike?

    Cheers,
    G√ľnther

    #13436

    spike

    Oh, yes indeed. Thanks, I’ll try that out.

    #13867

    spike

    Okay, so after using it in praxis, it doesn’t work that well.

     

    If I use Alec’s code it works for ColorOverlays, but a DropShadow or a Glow makes it completely invisible.

                Item{
                    id: item
                    height: 100
                    width: 100
    
                    MultiResolutionImage{
                        id: img1
                        source: "../assets/vplay-logo.png"
                        visible: false
                        transformOrigin: Item.TopLeft
                        height: 100 / internalContentScaleFactorForImages
                        width: 100 / internalContentScaleFactorForImages
                        scale: internalContentScaleFactorForImages
                        anchors.centerIn: parent
                    }
                    DropShadow {
                        anchors.fill: item
                        source: img1
                        horizontalOffset: 3
                        verticalOffset: 3
                        radius: 12.0
                        samples: 17
                        color: "#80FF0000"
                    }
                }

     

    Would be cool if there’s a solution which works for any QtGraphicalEffect.

     

    Thanks.

     

    #13879

    Alec

    I think the problem is that my original code isn’t very good. Try this instead:

     

    Item{
                id: item
                height: 100
                width: 100
                
                MultiResolutionImage{
                    id: img1
                    source: "../assets/vplay-logo.png"
                    visible: false
                    transformOrigin: Item.TopLeft
                    height: 100 / internalContentScaleFactorForImages
                    width: 100 / internalContentScaleFactorForImages
                    anchors.centerIn: parent
                }
                //                        DropShadow {
                //                            anchors.fill: img1
                //                            source: img1
                //                            horizontalOffset: 3
                //                            verticalOffset: 3
                //                            radius: 12.0
                //                            samples: 17
                //                            color: "#80FF0000"
                //                            scale: internalContentScaleFactorForImages
                //                        }
                //                        ColorOverlay{
                //                            anchors.fill: img1
                //                            color: "red"
                //                            source: img1
                //                            scale: internalContentScaleFactorForImages
                //                        }
                Glow {
                    radius: 8
                    samples: 17
                    source: img1
                    anchors.fill: img1
                    color: "orange"
                    scale: internalContentScaleFactorForImages
                }
            }

     

    #13884

    spike

    Thank you, Alec! Now it’s working as intended.

Viewing 7 posts - 1 through 7 (of 7 total)

RSS feed for this thread

You must be logged in to reply to this topic.