Qt image scaling parameter calculation

Zoom Image

void VCImgWidget::wheelEvent(QWheelEvent *event)
{
    IF ( Event -> Delta ()> 0 ) {
         // when the roller away from the user
         // ui-> textEdit-> the zoomIn ();                
         // amplifying
         // qDebug () << the event-> Delta (); 
        + = scale_img scale_img 0.1 ;
    }
    the else {
         // when the roller is rotated in the direction of the user
         // ui-> textEdit-> zoomOut ();              
         // for reduction
         // qDebug () << the event-> Delta (); 
        IF (scale_img> 0.3 )
        {
            scale_img = scale_img - 0.1;
        }
    }
    update();
}

 

Guess you like

Origin www.cnblogs.com/herd/p/11923741.html