Beispiel #1
0
        public int GetExtent(int dwDrawAspect, tagSIZEL pSizel)
        {
            ComDebug.ReportInfo("{0}.IOleObject.GetExtent", GetType().Name);
            if ((dwDrawAspect & (int)DVASPECT.DVASPECT_CONTENT) == 0)
            {
                return(ComReturnValue.E_FAIL);
            }

            var docSize_pt = _document.Size;

            pSizel = new tagSIZEL((int)(docSize_pt.X * PointsToHimetric), (int)(docSize_pt.Y * PointsToHimetric));

            return(ComReturnValue.NOERROR);
        }
Beispiel #2
0
        public int GetExtent(int dwDrawAspect, tagSIZEL pSizel)
        {
            ComDebug.ReportInfo("{0}.IOleObject.GetExtent", GetType().Name);
            if ((dwDrawAspect & (int)DVASPECT.DVASPECT_CONTENT) == 0)
            {
                return(ComReturnValue.E_FAIL);
            }

            var renderingOptions = EmbeddedGraphDocumentRenderingHelper.GetRenderingOptions(_document);

            var docSize_pt = _document.Size * renderingOptions.OutputScalingFactor;

            pSizel = new tagSIZEL((int)(docSize_pt.X * PointsToHimetric), (int)(docSize_pt.Y * PointsToHimetric));

            return(ComReturnValue.NOERROR);
        }
Beispiel #3
0
        public int SetExtent(int dwDrawAspect, tagSIZEL pSizel)
        {
            ComDebug.ReportInfo("{0}.IOleObject.SetExtent({1}x{2}) -> not supported.", GetType().Name, pSizel.cx, pSizel.cy);

            /*
             *                if ((dwDrawAspect & (int)DVASPECT.DVASPECT_CONTENT) != 0)
             *                {
             *                        try
             *                        {
             *                                _document.Size = new Graph.PointD2D(pSizel.cx / PointsToHimetric, pSizel.cy / PointsToHimetric);
             *                                return ComReturnValue.S_OK;
             *                        }
             *                        catch (Exception e)
             *                        {
             *                                Debug.ReportError("{0}.SetExtent threw an exception: {1}", this.GetType().Name, e);
             *                        }
             *                }
             */
            return(ComReturnValue.E_FAIL);
        }
Beispiel #4
0
        public int SetExtent(int dwDrawAspect, tagSIZEL pSizel)
        {
            ComDebug.ReportInfo("{0}.IOleObject.SetExtent({1}x{2}) -> not supported.", GetType().Name, pSizel.cx, pSizel.cy);

            return(ComReturnValue.E_FAIL);
        }
		public int GetExtent(int dwDrawAspect, tagSIZEL pSizel)
		{
			ComDebug.ReportInfo("{0}.IOleObject.GetExtent", this.GetType().Name);
			if ((dwDrawAspect & (int)DVASPECT.DVASPECT_CONTENT) == 0)
				return ComReturnValue.E_FAIL;

			var docSize_pt = _document.Size;

			pSizel = new tagSIZEL((int)(docSize_pt.X * PointsToHimetric), (int)(docSize_pt.Y * PointsToHimetric));

			return ComReturnValue.NOERROR;
		}
		public int SetExtent(int dwDrawAspect, tagSIZEL pSizel)
		{
			ComDebug.ReportInfo("{0}.IOleObject.SetExtent({1}x{2}) -> not supported.", this.GetType().Name, pSizel.cx, pSizel.cy);

			return ComReturnValue.E_FAIL;
		}
		public int GetExtent(int dwDrawAspect, tagSIZEL pSizel)
		{
			ComDebug.ReportInfo("{0}.IOleObject.GetExtent", this.GetType().Name);
			if ((dwDrawAspect & (int)DVASPECT.DVASPECT_CONTENT) == 0)
				return ComReturnValue.E_FAIL;

			var renderingOptions = EmbeddedGraphDocumentRenderingHelper.GetRenderingOptions(_document);

			var docSize_pt = _document.Size * renderingOptions.OutputScalingFactor;

			pSizel = new tagSIZEL((int)(docSize_pt.X * PointsToHimetric), (int)(docSize_pt.Y * PointsToHimetric));

			return ComReturnValue.NOERROR;
		}
		public int SetExtent(int dwDrawAspect, tagSIZEL pSizel)
		{
			ComDebug.ReportInfo("{0}.IOleObject.SetExtent({1}x{2}) -> not supported.", this.GetType().Name, pSizel.cx, pSizel.cy);

			/*
			if ((dwDrawAspect & (int)DVASPECT.DVASPECT_CONTENT) != 0)
			{
				try
				{
					_document.Size = new Graph.PointD2D(pSizel.cx / PointsToHimetric, pSizel.cy / PointsToHimetric);
					return ComReturnValue.S_OK;
				}
				catch (Exception e)
				{
					Debug.ReportError("{0}.SetExtent threw an exception: {1}", this.GetType().Name, e);
				}
			}
*/
			return ComReturnValue.E_FAIL;
		}