Beispiel #1
0
 internal override void DrawContent(GdiContext context)
 {
     if (Image == null)
     {
         return;
     }
     if (!m_processedImage)
     {
         if (Image is Bitmap)
         {
             ((Bitmap)Image).SetResolution(96f, 96f);
         }
         SharedRenderer.CalculateImageRectangle(ImagePosition, Image.Width, Image.Height, Image.HorizontalResolution, Image.VerticalResolution, Sizing, out ImagePosition, out ImagePositionPX);
         if (InstanceProperties is RPLImageProps)
         {
             ProcessActions(context, InstanceProperties.UniqueName, ((RPLImageProps)InstanceProperties).ActionInfo, ImagePosition);
         }
         ProcessImageMap(context);
         m_processedImage = true;
     }
     if (!(ImagePosition.Width <= 0f) && !(ImagePosition.Height <= 0f))
     {
         SharedRenderer.DrawImage(context.Graphics, Image, ImagePosition, ImagePositionPX);
     }
 }
        private void DrawResourceImage(GdiContext context, Bitmap image, RectangleF itemRectangleMM, RectangleF imageRectanglePX)
        {
            InterpolationMode interpolationMode = context.Graphics.InterpolationMode;

            context.Graphics.InterpolationMode = InterpolationMode.NearestNeighbor;
            SharedRenderer.DrawImage(context.Graphics, image, itemRectangleMM, imageRectanglePX);
            context.Graphics.InterpolationMode = interpolationMode;
        }