10. Graphics g = Graphics.FromImage(backbuffer);
// 당구공 이미지가 실제 그려지는 목적 Rectagle 의 크기 : 당구대 가로
길이의 약 5%
// 당구공 이미지가 실제 그려지는 목적 Rectagle 의 크기 :
당구대 가로 길이의 약 5%
// 당구공 이미지의 목적 Rectagle에 실제이미지를 넣어 넣어 그린후 투명
값을 넣어준다.
// 당구공 이미지의 목적 Rectagle에 실제이미지를 넣어 넣어 그린후
투명 값을 넣어준다.
e.Graphics.DrawImage(backbuffer, 0, 0);
11.
12. •
–
–
–
Graphics.DrawString (String, Font, Brush, RectangleF)
Graphics.DrawString (String, Font, Brush, RectangleF, StringFormat)
Graphics.DrawString (String, Font, Brush, Single, Single)
Graphics.DrawString (String, Font, Brush, Single, Single, StringFormat)
14. •
–
–
Graphics.DrawImage (Image, Rectangle, Single, Single, Single, Single, GraphicsUnit, ImageAttributes)
15. •
Graphics.DrawImage (Image, Rectangle, Single, Single, Single, Single, GraphicsUnit, ImageAttributes)
/* 이미지의 투명화 처리 */
// ImageAttrubutes 객체 생성
System.Drawing.Imaging.ImageAttributes attr = new System.Drawing.Imaging.ImageAttributes();
// 투명화 처리를 원하는 색을 가져와 attr.SetColorKey 에 저장한다.
// 본 예제에서는 이미지의 (0,0) pixel 값을 투명색으로 설정함.
attr.SetColorKey(_ballImage.GetPixel(0, 0), _ballImage.GetPixel(0, 0));
// 당구공 이미지가 실제 그려지는 목적 Rectagle 의 크기 : 당구대 가로 길이의 약 5%
Rectangle destRect = new Rectangle(ballX, ballY, ballSizeWidth, ballSizeHeight);
// 당구공 이미지의 목적 Rectagle에 실제이미지를 넣어 넣어 그린후 투명 값을 넣어준다.
g.DrawImage(_ballImage, destRect, 0, 0, _ballImage.Width, _ballImage.Height, GraphicsUnit.Pixel, attr);
16.
17. •
–
–
public static void DrawAlpha(Graphics gx, Bitmap image, byte transp, int x, int y)
18. •
–
–
–
–
–
• public static void DrawAlpha(Bitmap image, byte transp, int x, int y)
// 반투명 이미지를 당구대 바닥에 그린다.
19.
20. Code Project Mobile Development Forum
MSDN Windows Mobile
네이버 스마트폰 카페 개발자 포럼
•
•
–