2009-08-10 5 views
3

Windows Mobile 프로그래밍에서 비트 맵을 회전시키는 메커니즘이 있습니까?Windows Mobile 프로그래밍에서 이미지 회전

나는 이것을 어떤 각도로도 회전하고 싶다. RotateTransform가 CF에서 사용할 수 없습니다 때문에

+0

명확히하십시오. 이미지를 90/180/270도 또는 어떤 각도로 회전 시키시겠습니까? – zxcat

+1

속도 : http://stackoverflow.com/questions/875419/fast-method-to-rotate-image-in-net-compact-framework-in-c – ctacke

답변

2

당신은, 코드에서이 스스로해야 할 :

public Bitmap GetRotatedBitmap(Bitmap original) 
{ 
    Bitmap output = new Bitmap(original.Height, original.Width); 
    for (int x = 0; x < output.Width; x++) 
    { 
     for (int y = 0; y < output.Height; y++) 
     { 
      output.SetPixel(x, y, original.GetPixel(y, x)); 
     } 
    } 
    return output; 
} 

와 setPixel 및 getPixel와는 말도 느리다; 이 작업을 수행하는 더 빠른 방법은 LockBits 메서드를 사용하는 것입니다 (사용 방법을 보여주는 많은 질문이 있습니다).

+0

+1 로고. 위대한 답변자 역시. –