Beispiel #1
0
		public virtual System.Drawing.Size ThemeDrawSize(Graphics g, ThemePart part, ThemeState state)
		{
			SIZE m=new SIZE();
			IntPtr hdc=g.GetHdc();
            try
            {
                int hresult = GetThemePartSize(m_hTheme, hdc, part.Value, state.Value, IntPtr.Zero, 2, ref m);
            }
            finally
            {
                g.ReleaseHdc(hdc);
            }
			return new System.Drawing.Size(m.Width,m.Height);
		}
Beispiel #2
0
		public virtual bool IsPartDefined(ThemePart part, ThemeState state)
		{
			return IsThemePartDefined(m_hTheme,part.Value,state.Value);
		}
Beispiel #3
0
        protected virtual void InternalDrawTextEx(Graphics g, string text, Font font, Rectangle layoutRect, ThemePart part, ThemeState state, ThemeTextFormat format, DTTOPTS options)
        {
            RECT rDraw=new RECT(layoutRect);
			IntPtr hdc=g.GetHdc();
			IntPtr hFont=font.ToHfont();
            IntPtr old=SelectObject(hdc,hFont);
			//int hresult=DrawThemeText(m_hTheme,hdc,part.Value,state.Value,text,text.Length,(int)format,(drawdisabled?1:0),ref rDraw);
            options.dwSize = Marshal.SizeOf(options);
            int hresult = DrawThemeTextEx(m_hTheme, hdc, part.Value, state.Value, text, text.Length, (int)format, ref rDraw, ref options);

			SelectObject(hdc,old);
            WinApi.DeleteObject(hFont);
			g.ReleaseHdc(hdc);
        }
Beispiel #4
0
		protected virtual IntPtr InternalGetThemeBackgroundRegion(Graphics g, ThemePart part, ThemeState state, Rectangle r)
		{
			RECT rDraw=new RECT(r);
			IntPtr hdc=g.GetHdc();
            IntPtr region = IntPtr.Zero;
            try
            {
                GetThemeBackgroundRegion(m_hTheme, hdc, part.Value, state.Value, ref rDraw, ref region);
            }
            finally
            {
                g.ReleaseHdc(hdc);
            }
			return region;
		}
Beispiel #5
0
		protected virtual void InternalDrawBackground(Graphics g, ThemePart part, ThemeState state, Rectangle r, Rectangle clip)
		{
			RECT rDraw=new RECT(r);
			RECT rClip=new RECT(clip);
			IntPtr hdc=g.GetHdc();
            try
            {
                int hresult = DrawThemeBackground(m_hTheme, hdc, part.Value, state.Value, ref rDraw, ref rClip);
            }
            finally
            {
                g.ReleaseHdc(hdc);
            }
		}
Beispiel #6
0
 public void DrawTextEx(Graphics g, string text, Font font, Rectangle layoutRect, ThemePart part, ThemeState state, ThemeTextFormat format, DTTOPTS options)
 {
     InternalDrawTextEx(g, text, font, layoutRect, part, state, format, options);
 }