public Image this[uint type, ulong instance, THUMSize size, bool isPNGInstance] { get { SpecificResource item = getRK(type, instance, size, isPNGInstance); if (item != null && item.Resource != null) { return(Image.FromStream(item.Resource.Stream)); } return(null); } set { SpecificResource item = getItem(isPNGInstance ? FileTable.GameContent : FileTable.Thumbnails, instance, (isPNGInstance ? PNGTypes : thumTypes[type])[(int)size]); if (item == null || item.Resource == null) { throw new ArgumentException(); } Image thumb; thumb = value.GetThumbnailImage(thumSizes[(int)size], thumSizes[(int)size], () => false, System.IntPtr.Zero); thumb.Save(item.Resource.Stream, System.Drawing.Imaging.ImageFormat.Png); item.Commit(); } }
static IResourceKey getNewRK(uint type, ulong instance, THUMSize size, bool isPNGInstance) { return(new RK(RK.NULL) { ResourceType = (isPNGInstance ? PNGTypes : thumTypes[type])[(int)size], ResourceGroup = (uint)(type == 0x515CA4CD ? 1 : 0), Instance = instance, }); }
public static Image getImage(THUMSize size, SpecificResource item) { if (item.RequestedRK.CType() == CatalogType.ModularResource) { return(getImage(size, MainForm.ItemForTGIBlock0(item))); } else if (item.RequestedRK.CType() == CatalogType.CAS_Part) { return(Thumb[item.RequestedRK.ResourceType, item.RequestedRK.Instance, size, false]); } else { ulong png = (item.Resource != null) ? (ulong)item.Resource["CommonBlock.PngInstance"].Value : 0; return(Thumb[item.RequestedRK.ResourceType, png != 0 ? png : item.RequestedRK.Instance, size, png != 0]); } }
public static IResourceKey getNewRK(THUMSize size, SpecificResource item) { if (item.RequestedRK.CType() == CatalogType.ModularResource) { return(RK.NULL); } else if (item.RequestedRK.CType() == CatalogType.CAS_Part) { return(getNewRK(item.RequestedRK.ResourceType, item.RequestedRK.Instance, size, false)); } else { ulong png = (item.Resource != null) ? (ulong)item.Resource["CommonBlock.PngInstance"].Value : 0; return(getNewRK(item.RequestedRK.ResourceType, png != 0 ? png : item.RequestedRK.Instance, size, png != 0)); } }
public Image this[uint type, ulong instance, THUMSize size, bool isPNGInstance] { get { SpecificResource item = getRK(type, instance, size, isPNGInstance); if (item != null && item.Resource != null) return Image.FromStream(item.Resource.Stream); return null; } set { SpecificResource item = getItem(isPNGInstance ? FileTable.GameContent : FileTable.Thumbnails, instance, (isPNGInstance ? PNGTypes : thumTypes[type])[(int)size]); if (item == null || item.Resource == null) throw new ArgumentException(); Image thumb; thumb = value.GetThumbnailImage(thumSizes[(int)size], thumSizes[(int)size], () => false, System.IntPtr.Zero); thumb.Save(item.Resource.Stream, System.Drawing.Imaging.ImageFormat.Png); item.Commit(); } }
public Image this[uint type, ulong instance, THUMSize size] { get { return(this[type, instance, size, false]); } set { this[type, instance, size, false] = value; } }
public Image this[ulong instance, THUMSize size, bool isPNGInstance] { get { return(this[defType, instance, size, isPNGInstance]); } set { this[defType, instance, size, isPNGInstance] = value; } }
static SpecificResource getRK(uint type, ulong instance, THUMSize size, bool isPNGInstance) { return(getItem(isPNGInstance ? FileTable.GameContent : FileTable.Thumbnails, instance, (isPNGInstance ? PNGTypes : thumTypes[type])[(int)size])); }
static SpecificResource getRK(uint type, ulong instance, THUMSize size, bool isPNGInstance) { return getItem(isPNGInstance ? FileTable.GameContent : FileTable.Thumbnails, instance, (isPNGInstance ? PNGTypes : thumTypes[type])[(int)size]); }
public Image this[uint type, ulong instance, THUMSize size] { get { return this[type, instance, size, false]; } set { this[type, instance, size, false] = value; } }
public Image this[ulong instance, THUMSize size, bool isPNGInstance] { get { return this[defType, instance, size, isPNGInstance]; } set { this[defType, instance, size, isPNGInstance] = value; } }
public static Image getImage(THUMSize size, SpecificResource item) { if (item.RequestedRK.CType() == CatalogType.ModularResource) { return getImage(size, MainForm.ItemForTGIBlock0(item)); } else if (item.RequestedRK.CType() == CatalogType.CAS_Part) { return Thumb[item.RequestedRK.ResourceType, item.RequestedRK.Instance, size, false]; } else { ulong png = (item.Resource != null) ? (ulong)item.Resource["CommonBlock.PngInstance"].Value : 0; return Thumb[item.RequestedRK.ResourceType, png != 0 ? png : item.RequestedRK.Instance, size, png != 0]; } }
static IResourceKey getNewRK(uint type, ulong instance, THUMSize size, bool isPNGInstance) { return new RK(RK.NULL) { ResourceType = (isPNGInstance ? PNGTypes : thumTypes[type])[(int)size], ResourceGroup = (uint)(type == 0x515CA4CD ? 1 : 0), Instance = instance, }; }
public static IResourceKey getNewRK(THUMSize size, SpecificResource item) { if (item.RequestedRK.CType() == CatalogType.ModularResource) { return RK.NULL; } else if (item.RequestedRK.CType() == CatalogType.CAS_Part) { return getNewRK(item.RequestedRK.ResourceType, item.RequestedRK.Instance, size, false); } else { ulong png = (item.Resource != null) ? (ulong)item.Resource["CommonBlock.PngInstance"].Value : 0; return getNewRK(item.RequestedRK.ResourceType, png != 0 ? png : item.RequestedRK.Instance, size, png != 0); } }
public static uint getThumbType(uint parentType, THUMSize size, bool isPNGInstance) { return((isPNGInstance ? PNGTypes : thumTypes[parentType])[(int)size]); }