Skip to content

Commit

Permalink
EMR_MOVETOEX
Browse files Browse the repository at this point in the history
  • Loading branch information
KeterSCP committed Nov 9, 2023
1 parent 6d5de6e commit 754e12d
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions SharpEmf.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
<s:Boolean x:Key="/Default/UserDictionary/Words/=intercharacter/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=INTERSECTCLIPRECT/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Lineto/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=MOVETOEX/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=MXDC/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=NAMEDESCAPE/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=NEWFRAME/@EntryIndexedValue">True</s:Boolean>
Expand Down
5 changes: 5 additions & 0 deletions src/SharpEmf/Enums/EmfRecordType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ public enum EmfRecordType : uint
/// </summary>
EMR_OFFSETCLIPRGN = 0x0000001A,

/// <summary>
/// Defines coordinates of the new drawing position in logical units
/// </summary>
EMR_MOVETOEX = 0x0000001B,

/// <summary>
/// Defines a new clipping region that consists of the current clipping region intersected with the specified rectangle
/// </summary>
Expand Down
1 change: 1 addition & 0 deletions src/SharpEmf/Records/EnhancedMetafileRecord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public static EnhancedMetafileRecord Parse(Stream stream)
EmfRecordType.EMR_SETPOLYFILLMODE => EmrSetPolyfillMode.Parse,
EmfRecordType.EMR_SETPIXELV => EmrSetPixelV.Parse,
EmfRecordType.EMR_OFFSETCLIPRGN => EmrOffsetClipRgn.Parse,
EmfRecordType.EMR_MOVETOEX => EmrMoveToEx.Parse,
EmfRecordType.EMR_EXCLUDECLIPRECT => EmrExcludeClipRect.Parse,
EmfRecordType.EMR_INTERSECTCLIPRECT => EmrIntersectClipRect.Parse,
EmfRecordType.EMR_SELECTOBJECT => EmrSelectObject.Parse,
Expand Down
28 changes: 28 additions & 0 deletions src/SharpEmf/Records/State/EmrMoveToEx.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using JetBrains.Annotations;
using SharpEmf.Enums;
using SharpEmf.Interfaces;
using SharpEmf.WmfTypes;

namespace SharpEmf.Records.State;

/// <inheritdoc cref="EmfRecordType.EMR_MOVETOEX"/>
[PublicAPI]
public record EmrMoveToEx : EnhancedMetafileRecord, IEmfParsable<EmrMoveToEx>
{
/// <summary>
/// Specifies coordinates of the new drawing position in logical units
/// </summary>
public PointL Offset { get; }

private EmrMoveToEx(EmfRecordType Type, uint Size, PointL offset) : base(Type, Size)
{
Offset = offset;
}

public static EmrMoveToEx Parse(Stream stream, EmfRecordType recordType, uint size)
{
var offset = PointL.Parse(stream);

return new EmrMoveToEx(recordType, size, offset);
}
}

0 comments on commit 754e12d

Please sign in to comment.