انجمن سایت کلیدستان


رتبه موضوع:
  • 0 رای - 0 میانگین
  • 1
  • 2
  • 3
  • 4
  • 5
استفاده از دستورات چرخش تصاویر

استفاده از دستورات چرخش تصاویر

#1
سلام
به کد های زیر توجه کنید:
کد پی‌اچ‌پی:
View touchview=findViewById(R.id.result);
        
        
touchview.setOnTouchListener(new OnTouchListener() {

            
int xstart,xend,ystart,yend,changex,changey;
             
            @
Override

            
public boolean onTouch(View arg0MotionEvent event) {

                if (
event.getAction()==MotionEvent.ACTION_DOWN) {

                    
                    
xstart=(int) event.getRawX();
                    
ystart=(int) event.getRawY();
                    }

                if (
event.getAction()==MotionEvent.ACTION_UP) {

                    
xend=(int) event.getRawX();
                    
yend=(int) event.getRawY();
                    
                    
changex xend-xstart;
                    
changey yend-ystart;

                    if (
imageselected == true)
                    {
                        
                        
                        
                    if(
textmove)
                       {
                        
xtext xtext changex ;
                        
ytext ytext changey ;
                       }
                    else if(
editimage==1)
                          {
                        
                        if(
zoom){
                                   
bm1Widthzoom bm1Widthzoom changex;
                                
bm1Heightzoom bm1Heightzoom changey;
                                
bm1changed Bitmap.createScaledBitmap(bm1bm1Widthzoombm1Heightzoomfalse);
                                 }
                        if(
move){
                                
bm1ChangedXplace bm1ChangedXplace changex;
                                   
bm1ChangedYplace bm1ChangedYplace changey;
                                   
                                
                                  }
                        if(
crop){

                                if(
changex>changey && changex>0)
                                {
                                    if( 
cropimage1right cropimage1left changex )
                                        
cropimage1left cropimage1left changex ;
                                }
                                else if(-
changex>changey && changex<0)
                                {
                                    if( 
cropimage1right cropimage1left > -changex )
                                        
cropimage1right cropimage1right changex ;
                                }
                                else if(
changex<changey && changey>0)
                                {
                                    if( 
cropimage1down cropimage1up changey )
                                        
cropimage1up cropimage1up changey ;
                                }
                                else if(
changex<-changey && changey<0)
                                {                                    
                                    if( 
cropimage1down cropimage1up > -changey )
                                        
cropimage1down cropimage1down changey ;
                                }
                                
                                 }
                        

                        
                          }
                    else if(
editimage==2){


                        if(
zoom){
                                   
bm2Widthzoom bm2Widthzoom changex;
                                
bm2Heightzoom bm2Heightzoom changey;
                                
bm2changed Bitmap.createScaledBitmap(bm2bm2Widthzoombm2Heightzoomfalse);
                                    }
                           if(
move){
                                
bm2ChangedXplace bm2ChangedXplace changex;
                                   
bm2ChangedYplace bm2ChangedYplace changey;
                                    }
                           
                           if(
crop){

                            if(
changex>changey && changex>0)
                                
cropimage1left cropimage1left changex ;
                            else if(-
changex>changey && changex<0)
                                
cropimage1right cropimage1right changex ;
                            else if(
changex<changey && changey>0)
                                
cropimage1up cropimage1up changey ;
                            else if(
changex<-changey && changey<0)
                                
cropimage1down cropimage1down changey ;
                        
                            
                             }
                        

                    }
                    
                    
                        new 
ProcessingBitmapAsync().execute("");
                    }
                    

                }

                return 
true;

            }

        }); 
 با توجه به این کد ها مشخصه که ما سه دکمه دارمم :
zoom
move
crop

حالا به فرض اینکه دکمه ی چهارمی به نام چرخش 90 درجه هم داشته باشیم کد مخصوص به چرخش چیه میشه و باید اضاف بشه؟
تشکرر
 
پاسخ

استفاده از دستورات چرخش تصاویر

#2
دوستان نظری ندارند؟

 
پاسخ

استفاده از دستورات چرخش تصاویر

#3
دوستان دوباره نظری ندارند؟
پاسخ
 سپاس شده توسط شماره مجازی امارات ، تلگرام ضد فیلتر 2023


پرش به انجمن:


کاربران در حال بازدید این موضوع: 1 مهمان