• 图像适配源码


     public struct FitSizeTable
            {
               public  long fitw ;
               public  long fith;
               public float fitsize;
            }

            public FitSizeTable FitSize(long Srw, long Srh, long Dsw, long Dsh)
            {
                float SrBL = (float)Srh / Srw;
                float DsBL = (float)Dsh / Dsw;
              
                FitSizeTable DsetFitsize;
                
                if (SrBL > DsBL)
                {
                    DsetFitsize.fith = Dsh;


                    DsetFitsize.fitw =((long)Math.Round((float)Srw / Srh * Dsh));
                }
                else
                {
                    if (SrBL < DsBL)
                    {
                        DsetFitsize.fitw = Dsw;
                        DsetFitsize.fith = (long)SrBL * Dsh;
                    }
                    else
                    {
                        DsetFitsize.fith = Dsh;
                        DsetFitsize.fitw = Dsw;
                    }
                }

               DsetFitsize.fitsize = (float)Math.Round((float)DsetFitsize.fith / Srh, 2);
               return DsetFitsize;
            }

  • 相关阅读:
    第03组 Beta冲刺(4/5)
    第03组 Beta冲刺(3/5)
    第03组 Beta冲刺(2/5)
    第03组 Beta冲刺(1/5)
    第03组 Alpha冲刺(6/6)
    第03组 Alpha冲刺(5/6)
    软工实践个人总结
    最终作业
    Beta答辩总结
    Beta 冲刺(7/7)
  • 原文地址:https://www.cnblogs.com/dongzhaosheng/p/2801721.html
Copyright © 2020-2023  润新知