예제 #1
0
 public static extern bool GetTextExtentPoint32(
     IntPtr hdc,
     [MarshalAs(UnmanagedType.LPTStr)] string lpString,
     int cbString,
     out SIZE lpSize
     );
예제 #2
0
 public static extern bool UpdateLayeredWindow(
     IntPtr hwnd,
     IntPtr hdcDst,
     ref POINT pptDst,
     ref SIZE psize,
     IntPtr hdcSrc,
     ref POINT pptSrc,
     uint crKey,
     ref BLENDFUNCTION pblend,
     uint dwFlags);
예제 #3
0
        /// <summary>
        /// Requests that the container scroll to get the object in view (will never
        /// be called for a Document Object / MSHTML since by definition document
        /// object's take up the entire container window)
        /// </summary>
        /// <param name="scrollExtant"></param>
        void IOleInPlaceSite.Scroll(SIZE scrollExtant)
        {
            // log access to method
            LOG_UN("IOleInPlaceSite", "Scroll");

            // not-implemented
            ComHelper.Return(HRESULT.E_NOTIMPL);
        }
 /// <summary>
 /// IHTMLPainter.Resize -- Called by MSHTML when an element containing a rendering behavior is resized
 /// </summary>
 /// <param name="size">SIZE structure that specifies the new width and height for the element,
 /// including any expanded region</param>
 public virtual void OnResize(SIZE size)
 {
 }
예제 #5
0
        private void UpdateBitmap()
        {
            using (Bitmap bitmap = CreateBitmap())
            {
                IntPtr screenDC = User32.GetDC(IntPtr.Zero);
                try
                {
                    IntPtr memDC = Gdi32.CreateCompatibleDC(screenDC);
                    try
                    {
                        IntPtr hBitmap = bitmap.GetHbitmap(Color.FromArgb(0));
                        try
                        {
                            IntPtr hOrigBitmap = Gdi32.SelectObject(memDC, hBitmap);
                            try
                            {
                                POINT dst = new POINT();
                                dst.x = Left;
                                dst.y = Top;

                                SIZE size = new SIZE();
                                size.cx = bitmap.Width;
                                size.cy = bitmap.Height;

                                POINT src = new POINT();
                                src.x = 0;
                                src.y = 0;

                                User32.BLENDFUNCTION blendFunction = new User32.BLENDFUNCTION();
                                blendFunction.BlendOp = 0; // AC_SRC_OVER
                                blendFunction.BlendFlags = 0;
                                blendFunction.SourceConstantAlpha = 255;
                                blendFunction.AlphaFormat = 1; // AC_SRC_ALPHA

                                User32.UpdateLayeredWindow(Handle, screenDC, ref dst, ref size, memDC, ref src, 0, ref blendFunction, 2);
                            }
                            finally
                            {
                                Gdi32.SelectObject(memDC, hOrigBitmap);
                            }
                        }
                        finally
                        {
                            Gdi32.DeleteObject(hBitmap);
                        }
                    }
                    finally
                    {
                        Gdi32.DeleteDC(memDC);
                    }
                }
                finally
                {
                    User32.ReleaseDC(IntPtr.Zero, screenDC);
                }
            }
        }
 public override void OnResize(SIZE size)
 {
     _elementSize = new Size(size.cx, size.cy) ;
     _widgetLocation = new Point(_elementSize.Width - _widgetEnabled.Width, WIDGET_VERTICAL_OFFSET) ;
     _widgetArea = new Rectangle( _widgetLocation, _widgetEnabled.Size );
 }
 public override void OnResize(SIZE size)
 {
     if (Attached)
         SynchronizeElementRectangle();
 }
 public override void OnResize(SIZE size)
 {
     base.OnResize(size);
     if (Attached && _resizerControl.Mode != SizerMode.Resizing)
         SynchronizeResizerWithElement();
 }