SIL.Utils.ImagePicture.Render C# (CSharp) 메소드

Render() 공개 메소드

public Render ( IntPtr hdc, int x, int y, int cx, int cy, int xSrc, int ySrc, int cxSrc, int cySrc, IntPtr prcWBounds ) : void
hdc System.IntPtr
x int
y int
cx int
cy int
xSrc int
ySrc int
cxSrc int
cySrc int
prcWBounds System.IntPtr
리턴 void
		public void Render(
			IntPtr hdc,
			int x,
			int y,
			int cx,
			int cy,
			int xSrc,
			int ySrc,
			int cxSrc,
			int cySrc,
			IntPtr prcWBounds)
		{
			using (Graphics gr = Graphics.FromHdc(hdc))
			{

				// Sometimes width or height is negative and we are expected to draw backwards (which DrawImage doesn't seem to do)
				if (cySrc < 0)
				{
					cySrc = Math.Abs(cySrc);
					ySrc -= cySrc;
				}

				if (cxSrc < 0)
				{
					cxSrc = Math.Abs(cxSrc);
					xSrc -= cxSrc;
				}

				gr.DrawImage(m_img, new Rectangle(x, y, cx, cy),
							 new Rectangle(
									  new HiMetric(xSrc).GetPixels(dpiX),
									  new HiMetric(ySrc).GetPixels(dpiY),
									  new HiMetric(cxSrc).GetPixels(dpiX),
									  new HiMetric(cySrc).GetPixels(dpiY)), GraphicsUnit.Pixel);
			}
		}

Same methods

ImagePicture::Render ( int hdc, int x, int y, int cx, int cy, int xSrc, int ySrc, int cxSrc, int cySrc, IntPtr prcWBounds ) : void