Skip to main content

Class ImageItemHandler

Namespace: Aurigma.DesignAtoms.Canvas.ItemHandlers​
Assembly: Aurigma.DesignAtoms.dll​
Syntax
public class ImageItemHandler : ContentItemHandler, ICloneable, IDisposable

Inheritance: System.Object -> Aurigma.DesignAtoms.Canvas.ItemHandlers.ItemHandler -> Aurigma.DesignAtoms.Canvas.ItemHandlers.BaseRectangleItemHandler -> Aurigma.DesignAtoms.Canvas.ItemHandlers.ShapeItemHandler -> Aurigma.DesignAtoms.Canvas.ItemHandlers.RectangleItemHandler -> Aurigma.DesignAtoms.Canvas.ItemHandlers.ContentItemHandler -> ImageItemHandler

Implements​

  • System.ICloneable
  • System.IDisposable

Inherited Members​

Constructors​

ImageItemHandler​

public ImageItemHandler(IConfiguration configuration, IFileCache fileCache, IStateResourcesRepository stateResourcesRepository, IColorManagement colorManagement, IImageLoader imageLoader, IItemHandlerFactory itemHandlerFactory, IFontService fontService, ISvgReaderFactory svgReaderFactory, IGmColorConverter gmColorConverter, IPublicImagesProvider publicImagesProvider, IUserImagesProvider userImagesProvider, IRemoteImageLoader remoteImageLoader, ISessionContext sessionContext, ImageItem item)

Properties​

Item​

public ImageItem Item { get; }

TakeIntoAccountImageDpi​

public bool TakeIntoAccountImageDpi { get; }

NeedToDownloadImage​

public bool NeedToDownloadImage { get; set; }

SourcePageIndex​

public int SourcePageIndex { get; set; }

Effect​

public ImageEffect Effect { get; set; }

IsVector​

public bool IsVector { get; }

ContainsOnlyVectorElements​

public bool ContainsOnlyVectorElements { get; }

PageIndex​

protected override int PageIndex { get; }

CanExtendPipeline​

public bool CanExtendPipeline { get; }

Methods​

GetObjectId​

protected override string GetObjectId()
Returns​

System.String

Overrides​

IsImageAvailableAsync​

protected override Task<bool> IsImageAvailableAsync()
Returns​

System.Threading.Tasks.Task<System.Boolean>

Overrides​

GetImageStreamAsync​

protected override Task<Stream> GetImageStreamAsync(float dpi, bool isPreview, IColorProfilesProvider profilesProvider, IRenderingColorSettings colorSettings)
Parameters​
TypeNameDescription
System.Singledpi
System.BooleanisPreview
Aurigma.DesignAtoms.ColorManagement.IColorProfilesProviderprofilesProvider
Aurigma.DesignAtoms.ColorManagement.IRenderingColorSettingscolorSettings
Returns​

System.Threading.Tasks.Task<System.IO.Stream>

Overrides​

GetItemHandlerData​

public override ItemHandlerData GetItemHandlerData()
Returns​

Aurigma.DesignAtoms.Canvas.ItemHandlers.ItemHandlerData

Overrides​

GetItemHandlerDataType​

public override string GetItemHandlerDataType()
Returns​

System.String

Overrides​

IsUpscaleRequired​

protected override bool IsUpscaleRequired(bool isSingleColorTargetContainer, IImageParams sourceElement, float dpiX, float dpiY)
Parameters​
TypeNameDescription
System.BooleanisSingleColorTargetContainer
Aurigma.GraphicsMill.IImageParamssourceElement
System.SingledpiX
System.SingledpiY
Returns​

System.Boolean

Overrides​

AddImageEffectToPipeline​

protected override Pipeline AddImageEffectToPipeline(IConfiguration configuration, IImageParams source, Pipeline pipeline, PixelFormat colorizeDestPixelFormat, IRenderingColorSettings colorSettings, IColorProfilesProvider profilesProvider, IList<IDisposable> deps)
Parameters​
TypeNameDescription
Aurigma.DesignAtoms.Configuration.IConfigurationconfiguration
Aurigma.GraphicsMill.IImageParamssource
Aurigma.GraphicsMill.Pipelinepipeline
Aurigma.DesignAtoms.Model.Color.PixelFormatcolorizeDestPixelFormat
Aurigma.DesignAtoms.ColorManagement.IRenderingColorSettingscolorSettings
Aurigma.DesignAtoms.ColorManagement.IColorProfilesProviderprofilesProvider
System.Collections.Generic.IList<System.IDisposable>deps
Returns​

Aurigma.GraphicsMill.Pipeline

Overrides​

AddOverlayEffectToPipeline​

protected override void AddOverlayEffectToPipeline(IImageParams reader, Pipeline pipeline, IRenderingColorSettings colorSettings, PixelFormat destinationPixelFormat, IColorProfilesProvider profilesProvider)
Parameters​
TypeNameDescription
Aurigma.GraphicsMill.IImageParamsreader
Aurigma.GraphicsMill.Pipelinepipeline
Aurigma.DesignAtoms.ColorManagement.IRenderingColorSettingscolorSettings
Aurigma.DesignAtoms.Model.Color.PixelFormatdestinationPixelFormat
Aurigma.DesignAtoms.ColorManagement.IColorProfilesProviderprofilesProvider
Overrides​

GetDrawingFillColor​

protected override Color GetDrawingFillColor(PixelFormat destinationPixelFormat, IColorProfilesProvider profilesProvider)
Parameters​
TypeNameDescription
Aurigma.DesignAtoms.Model.Color.PixelFormatdestinationPixelFormat
Aurigma.DesignAtoms.ColorManagement.IColorProfilesProviderprofilesProvider
Returns​

Aurigma.GraphicsMill.Color

Overrides​

DrawContent​

protected override void DrawContent(RenderingContext renderingContext, Graphics graphics, IImageParams destImageParams, DrawItemParams drawItemParams, IRenderingColorSettings colorSettings, IColorProfilesProvider profilesProvider, bool rasterizeVectorLayers, CompressionType? pdfCompression, bool isPreview, bool isSingleColorTargetContainer, bool isPdfRenderDeviceProfileEnabled, ImageEffect effect)
Parameters​
TypeNameDescription
Aurigma.DesignAtoms.Canvas.RenderingContextrenderingContext
Aurigma.GraphicsMill.AdvancedDrawing.Graphicsgraphics
Aurigma.GraphicsMill.IImageParamsdestImageParams
Aurigma.DesignAtoms.Canvas.ItemHandlers.DrawItemParamsdrawItemParams
Aurigma.DesignAtoms.ColorManagement.IRenderingColorSettingscolorSettings
Aurigma.DesignAtoms.ColorManagement.IColorProfilesProviderprofilesProvider
System.BooleanrasterizeVectorLayers
System.Nullable<Aurigma.DesignAtoms.Configuration.RenderingConfig.CompressionType>pdfCompression
System.BooleanisPreview
System.BooleanisSingleColorTargetContainer
System.BooleanisPdfRenderDeviceProfileEnabled
Aurigma.DesignAtoms.Model.Items.ImageEffecteffect
Overrides​

NeedRasterizeVectorContent​

protected override bool NeedRasterizeVectorContent()
Returns​

System.Boolean

Overrides​

GetImageCombiner​

protected override Transform GetImageCombiner(IImageParams destImageParams, IRenderingColorSettings colorSettings, IColorProfilesProvider profilesProvider, float scale, IEnumerable<IDisposable> deps, ScaleAlpha alpha, PointF offset, bool isPreview, bool isSingleColorTargetContainer = false)
Parameters​
TypeNameDescription
Aurigma.GraphicsMill.IImageParamsdestImageParams
Aurigma.DesignAtoms.ColorManagement.IRenderingColorSettingscolorSettings
Aurigma.DesignAtoms.ColorManagement.IColorProfilesProviderprofilesProvider
System.Singlescale
System.Collections.Generic.IEnumerable<System.IDisposable>deps
Aurigma.GraphicsMill.Transforms.ScaleAlphaalpha
Aurigma.DesignAtoms.Model.Math.PointFoffset
System.BooleanisPreview
System.BooleanisSingleColorTargetContainer
Returns​

Aurigma.GraphicsMill.Transforms.Transform

Overrides​

GetOverlayEffect​

public static IEnumerable<PipelineElement> GetOverlayEffect(OverlayEffect overlayEffect, IImageParams source, Pipeline currentPipeline, IColorManagement colorManagement, IRenderingColorSettings colorSettings, IColorProfilesProvider profilesProvider, IConfiguration conf, IGmColorConverter gmColorConverter)
Parameters​
TypeNameDescription
Aurigma.DesignAtoms.Model.Items.OverlayEffectoverlayEffect
Aurigma.GraphicsMill.IImageParamssource
Aurigma.GraphicsMill.PipelinecurrentPipeline
Aurigma.DesignAtoms.ColorManagement.IColorManagementcolorManagement
Aurigma.DesignAtoms.ColorManagement.IRenderingColorSettingscolorSettings
Aurigma.DesignAtoms.ColorManagement.IColorProfilesProviderprofilesProvider
Aurigma.DesignAtoms.Configuration.IConfigurationconf
Aurigma.DesignAtoms.ColorManagement.IGmColorConvertergmColorConverter
Returns​

System.Collections.Generic.IEnumerable<Aurigma.GraphicsMill.PipelineElement>

VectorContentSupported​

public static bool VectorContentSupported(IConfiguration configuration, FileFormat fileFormat, IExternalConverter externalConverter = null)
Parameters​
TypeNameDescription
Aurigma.DesignAtoms.Configuration.IConfigurationconfiguration
Aurigma.DesignAtoms.Model.Configuration.FileFormatfileFormat
Aurigma.DesignAtoms.Common.ExternalConverter.IExternalConverterexternalConverter
Returns​

System.Boolean

GetAlphaMaskPipelines​

public static IEnumerable<PipelineElement> GetAlphaMaskPipelines(Bitmap bitmap, Size size)
Parameters​
TypeNameDescription
Aurigma.GraphicsMill.Bitmapbitmap
System.Drawing.Sizesize
Returns​

System.Collections.Generic.IEnumerable<Aurigma.GraphicsMill.PipelineElement>

UpdateRectangle​

public override void UpdateRectangle(bool keepLocation, PlaceholderItem.ResizeMode resizeMode, PlaceholderItem parentPlaceholder, float? sourceWidth = null, float? sourceHeight = null, float? dpiX = null, float? dpiY = null)
Parameters​
TypeNameDescription
System.BooleankeepLocation
Aurigma.DesignAtoms.Model.Items.PlaceholderItem.ResizeModeresizeMode
Aurigma.DesignAtoms.Model.Items.PlaceholderItemparentPlaceholder
System.Nullable<System.Single>sourceWidth
System.Nullable<System.Single>sourceHeight
System.Nullable<System.Single>dpiX
System.Nullable<System.Single>dpiY
Overrides​

SetWidth​

public void SetWidth(float width, bool calculateHeight = true)
Parameters​
TypeNameDescription
System.Singlewidth
System.BooleancalculateHeight

SetHeight​

public void SetHeight(float height, bool calculateWidth = true)
Parameters​
TypeNameDescription
System.Singleheight
System.BooleancalculateWidth

UpdateImageItemRectangle​

public static void UpdateImageItemRectangle(IItemHandlerFactory itemHandlerFactory, IImageLoader imageLoader, ContentItem contentItem, bool keepLocation, PlaceholderItem.ResizeMode resizeMode, PlaceholderItem parentPlaceholder)
Parameters​
TypeNameDescription
Aurigma.DesignAtoms.Canvas.ItemHandlers.IItemHandlerFactoryitemHandlerFactory
Aurigma.DesignAtoms.Canvas.IImageLoaderimageLoader
Aurigma.DesignAtoms.Model.Items.ContentItemcontentItem
System.BooleankeepLocation
Aurigma.DesignAtoms.Model.Items.PlaceholderItem.ResizeModeresizeMode
Aurigma.DesignAtoms.Model.Items.PlaceholderItemparentPlaceholder
Was this page helpful?