Merge pull request #322 from AttorneyOnline/in1tiate/aoimage-masking
Add proper alpha masking to AOImage elements
This commit is contained in:
		
						commit
						30be47ebfc
					
				@ -2,6 +2,8 @@
 | 
			
		||||
 | 
			
		||||
#include "aoimage.h"
 | 
			
		||||
 | 
			
		||||
#include <QBitmap>
 | 
			
		||||
 | 
			
		||||
AOImage::AOImage(QWidget *parent, AOApplication *p_ao_app) : QLabel(parent)
 | 
			
		||||
{
 | 
			
		||||
  m_parent = parent;
 | 
			
		||||
@ -29,9 +31,10 @@ bool AOImage::set_image(QString p_image)
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  QPixmap f_pixmap(final_image_path);
 | 
			
		||||
 | 
			
		||||
  this->setPixmap(
 | 
			
		||||
      f_pixmap.scaled(this->width(), this->height(), Qt::IgnoreAspectRatio));
 | 
			
		||||
  f_pixmap =
 | 
			
		||||
      f_pixmap.scaled(this->width(), this->height(), Qt::IgnoreAspectRatio);
 | 
			
		||||
  this->setPixmap(f_pixmap);
 | 
			
		||||
  this->setMask(f_pixmap.mask());
 | 
			
		||||
  return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -45,7 +48,9 @@ bool AOImage::set_chatbox(QString p_path)
 | 
			
		||||
 | 
			
		||||
  QPixmap f_pixmap(p_path);
 | 
			
		||||
 | 
			
		||||
  this->setPixmap(
 | 
			
		||||
      f_pixmap.scaled(this->width(), this->height(), Qt::IgnoreAspectRatio));
 | 
			
		||||
  f_pixmap =
 | 
			
		||||
      f_pixmap.scaled(this->width(), this->height(), Qt::IgnoreAspectRatio);
 | 
			
		||||
  this->setPixmap(f_pixmap);
 | 
			
		||||
  this->setMask(f_pixmap.mask());
 | 
			
		||||
  return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user