m
mihamuzApril 13, 2020, 3:28 p.m.

Альфа канал

QImage, Qrgba

Доброй ночи! Такой вопрос. Формирую цветную картинку используя класс QImage. Ни как не могу врубить прозрачность альфа канала пишу так:
QImage img;
img.setPixelColor(x,y,qRgba(250,100,200,0.5));
а в ответ тишина(

We recommend hosting TIMEWEB
We recommend hosting TIMEWEB
Stable hosting, on which the social network EVILEG is located. For projects on Django we recommend VDS hosting.

Do you like it? Share on social networks!

5
m
  • April 13, 2020, 3:29 p.m.

Сохраняю соответственно в png

    Evgenii Legotckoi
    • April 14, 2020, 4:57 a.m.

    канал альфа задаётся от 0 до 255

      m
      • April 14, 2020, 5:53 a.m.
      • (edited)

      img.setPixelColor(x,y,qRgba(250,100,200,100)); Все заливается в черный(

        Evgenii Legotckoi
        • April 14, 2020, 6:07 a.m.

        Используйте тогда формирование альфа канала через конструирование объекта QColor, а не через макрос qRgba

        img.setPixelColor(x, y, QColor(250,100,200,100)); 
        
          m
          • April 14, 2020, 6:13 a.m.
          • (edited)
          • The answer was marked as a solution.

          В итоге методом тыка получилось следующее:
          QImage* img = new QImage(h, w, QImage::Format_ARGB32);
          QColor color(250,100,200);
          color.setAlphaF(0.5);
          img->setPixelColor(x, y, color);
          А с макросом явно косячки какие-то)

            Comments

            Only authorized users can post comments.
            Please, Log in or Sign up
            AD

            C ++ - Test 004. Pointers, Arrays and Loops

            • Result:50points,
            • Rating points-4
            m

            C ++ - Test 004. Pointers, Arrays and Loops

            • Result:80points,
            • Rating points4
            m

            C ++ - Test 004. Pointers, Arrays and Loops

            • Result:20points,
            • Rating points-10
            Last comments
            i
            innorwallNov. 12, 2024, 9:12 a.m.
            Django - Tutorial 055. How to write auto populate field functionality Freckles because of several brand names retin a, atralin buy generic priligy
            i
            innorwallNov. 12, 2024, 5:23 a.m.
            QML - Tutorial 035. Using enumerations in QML without C ++ priligy cvs 24 Together with antibiotics such as amphotericin B 10, griseofulvin 11 and streptomycin 12, chloramphenicol 9 is in the World Health Organisation s List of Essential Medici…
            i
            innorwallNov. 12, 2024, 2:50 a.m.
            Qt/C++ - Lesson 052. Customization Qt Audio player in the style of AIMP It decreases stress, supports hormone balance, and regulates and increases blood flow to the reproductive organs buy priligy online safe Promising data were reported in a PDX model re…
            i
            innorwallNov. 12, 2024, 1:19 a.m.
            Heap sorting algorithm The role of raloxifene in preventing breast cancer priligy precio
            i
            innorwallNov. 12, 2024, 12:55 a.m.
            PyQt5 - Lesson 006. Work with QTableWidget buy priligy 60 mg 53 have been reported by Javanovic Santa et al
            Now discuss on the forum
            i
            innorwallNov. 12, 2024, 7:56 a.m.
            добавить qlineseries в функции buy priligy senior brother Chu He, whom he had known for many years
            i
            innorwallNov. 11, 2024, 9:55 p.m.
            Всё ещё разбираюсь с кешем. priligy walgreens levitra dulcolax carbs The third ring was found to be made up of ultra relativistic electrons, which are also present in both the outer and inner rings
            9
            9AnonimOct. 25, 2024, 7:10 p.m.
            Машина тьюринга // Начальное состояние 0 0, ,<,1 // Переход в состояние 1 при пустом символе 0,0,>,0 // Остаемся в состоянии 0, двигаясь вправо при встрече 0 0,1,>…

            Follow us in social networks