Jump to content

xchellx

Members
  • Posts

    28
  • Joined

  • Last visited

Posts posted by xchellx

  1. 21 minutes ago, Rick Brewster said:

    When you install the app with the regular installer EXE, it will create a log file called C:\Windows\SystemTemp\pdnSetupActionsInstall.log. This contains, among other things, all of the registry entries it creates (or deletes, if updating or uninstalling).

     

    Start with the line containing the text RegistryHandler::Register and you'll see what registry entries are created, and how it is associated with each file extension. You won't need all of them but it should be reasonably obvious.

    Is there any way I can "dry run" the installer to figure this out? I do not want to modify my current environment just to figure this out. Or can you list the specific entries it modifies?

  2. 17 hours ago, Disk4mat said:

    Im figuring there is some reason for not installing the app. Did you open the command prompt as an admin?

     
    Yes, from Windows Key + R -> cmd.exe -> Ctrl + Shift + Enter -> UAC Prompt:

    Spoiler
    Microsoft Windows [Version 10.0.19044.2965]
    (c) Microsoft Corporation. All rights reserved.
    
    C:\Windows\system32>cd C:\Users\xjonx\AppData\Roaming\paint.net
    
    C:\Users\xjonx\AppData\Roaming\paint.net>regsvr32 PaintDotNet.ShellExtension.x64.dll
    
    C:\Users\xjonx\AppData\Roaming\paint.net>


    I get:

    Spoiler
    ---------------------------
    RegSvr32
    ---------------------------
    The module "PaintDotNet.ShellExtension.x64.dll" was loaded but the entry-point DllRegisterServer was not found.
    
    Make sure that "PaintDotNet.ShellExtension.x64.dll" is a valid DLL or OCX file and then try again.
    ---------------------------
    OK   
    ---------------------------
    


    And from Start -> Visual Studio 2022 -> Developer Command Prompt for VS 2022 -> Right Click -> More -> Run as administrator -> UAC Prompt:

    Spoiler
    **********************************************************************
    ** Visual Studio 2022 Developer Command Prompt v17.6.2
    ** Copyright (c) 2022 Microsoft Corporation
    **********************************************************************
    
    C:\Windows\System32>cd C:\Users\xjonx\AppData\Roaming\paint.net
    
    C:\Users\xjonx\AppData\Roaming\paint.net>regasm PaintDotNet.ShellExtension.x64.dll
    Microsoft .NET Framework Assembly Registration Utility version 4.8.9037.0
    for Microsoft .NET Framework version 4.8.9037.0
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
    RegAsm : error RA0000 : Failed to load 'C:\Users\xjonx\AppData\Roaming\paint.net\PaintDotNet.ShellExtension.x64.dll' because it is not a valid .NET assembly
    
    C:\Users\xjonx\AppData\Roaming\paint.net>


    And yes, I do have paint.net installed portably so I can move it to a new computer (copying over %APPDATA%) without having to reinstall it (makes setting up a new PC easier).

  3. 13 hours ago, Rick Brewster said:

    From an implementation standpoint, the PaintDotNet.ShellExtension.[x64/arm64].dll should work fine if you register it correctly. I don't think it has any DLL dependencies.

     

    What about just a script that does that with the portable installation, after copying it to some suitable location?

    How do I register it manually? regsvr32 does not like it (missing `DllRegisterServer`), and regasm requires a C# DLL.

  4. No, sadly that does not help. This post is not of an issue of no thumbnails appearing. Thumbnails for any other type of file format work perfectly fine on my install. I know thumbnails for .pdn files will work if I "install" Paint.NET but I wish to use the portable version instead, therefore I did not install it and therefore do not have thumbnail functionality for .pdn files, hence why I made my own ShellExtension to do this instead (so I dont have to install paint.net).

    And still... my original question was... which subforum do I post about such ShellExtension I made?

  5. Quote

    1: Size Shift: The size of the brush increases or decreases by the chosen amount as you draw. When it's as large as allowed, it begins to shrink, and vice versa.

    What do you mean by "When it's as large as allowed"? What exactly specifies as the "allowed" size here? Random Size Min and Random Size Max for Jitter don't seem to affect this.

  6. How much parts of a plugin needs to be public? Like, what needs to be public so paint.net can see it from the assembly?
    As in:
    SaveConfigWidget: public or can be internal?
    SaveConfigToken: public or can be internal?
    IPluginSupportInfo: public or can be internal?
    IFileTypeFactory: public or can be internal?
    FileType: public or can be internal?

  7. I am continuing work on a plugin. Instead of setting the `IPluginSupportInfo.WebsiteUri` to `https://www.getpaint.net/redirect/plugins.html`, I'd thought to set it to the link to the plugin page instead. However, I realized the page link is linked to the post title, meaning if I change the title, the link will change thus making a unstable temporary link that can change at any time. Is there a way to get a permanent link to a forum post here? Like Reddit's permalink?

    • Like 1
  8. Summery:

    This is a plugin that allows opening of the TXTR file format found in the Metroid Prime series of games. It supports all texture types of the format and allows for saving and loading the format.

     

    Features:

    • Supports loading and saving every type of texture
    • Automatically handles pixel coordinate flipping
    • Supports mipmap loading and generation

     

    Note(s):

    There is a bug where saving the format does not show the saved mipmaps as layers. This is because the format doesn't support Paint.NET's layers (it only reads the first layer) and for mipmaps it generates them automatically. So, when saving, Paint.NET will ask to flatten the image which if the saved texture has mipmaps then the saved result wont show the mipmaps as layers. Re-opening the file fixes this issue.

     

    Download:

    TXTRFileType.7z

     

    Changelog:

    v1.2.0
    Updated the save UI, it now reacts to dark theme more accurately.
    Seperated the mipmap size limit to a width and height limit (also in save UI).
    Updated the codebasea a lot. See the github for more information.
    Added dialog choice at load to ask if to load all mipmaps or just the first mipmap
    
    v1.1.0
    Defaults button fixed. Added setting to limit mipmap count by size limit.
    
    v1.0.1
    Fixed certain MP2 TXTRs causing a crash.
    
    v1.0.0
    Initial stable release.

     

    Source Code:

    https://github.com/xchellx/TXTRFileType

  9. Unfortunately, these templates use the .NET Framework. The newest Paint.NET alpha (which I wish to target with my plugin, for reasons of having the newest C# 9 features) uses .NET 5. If I do what these templates do (which is target the Paint.NET DLLs, copy plugin dll to FileTypes/Effects folder at post build, then start Paint.NET as the debug action) with the new SDK csproj format as well as targeting `net5.0-windows`, it'll complain of DLL conflicts due to different versions that the plugin is using compared to Paint.NET. Do you plan on fixing these templates for .NET 5?
    EDIT:
    After some messing around, I did get it to compile. Although, it would be nice to have these templates updated...


    New csproj format properties:

    Spoiler

     

      <PropertyGroup>
        <OutputType>Library</OutputType>
        <TargetFramework>net5.0-windows</TargetFramework>
        <UseWindowsForms>true</UseWindowsForms>
        <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
        <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
        <GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
        <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
      </PropertyGroup>


    Paint.NET DLL references:

    Spoiler

     

      <ItemGroup>
        <Reference Include="PaintDotNet.Base">
          <HintPath>C:\Program Files\paint.net\PaintDotNet.Base.dll</HintPath>
        </Reference>
        <Reference Include="PaintDotNet.Core">
          <HintPath>C:\Program Files\paint.net\PaintDotNet.Core.dll</HintPath>
        </Reference>
        <Reference Include="PaintDotNet.Data">
          <HintPath>C:\Program Files\paint.net\PaintDotNet.Data.dll</HintPath>
        </Reference>
      </ItemGroup>


     
    PostBuild event (new csproj format):

    Spoiler

     

      <Target Name="PostBuild" AfterTargets="PostBuildEvent">
        <Exec Command="if exist &quot;$(TargetPath)&quot; (&#xD;&#xA;  copy &quot;$(TargetPath)&quot; &quot;C:\Program Files\paint.net\FileTypes\&quot;&#xD;&#xA;) else (&#xD;&#xA;  echo ERROR: Failed to copy plugin! Check if the build failed.&#xD;&#xA;  exit(1)&#xD;&#xA;)" />
      </Target>



    Then add this to the end of your AssemblyInfo.cs:

    Spoiler

     

    [assembly: SupportedOSPlatform("windows")]


     

    And finally, debugging paint.net at start debug:

    Spoiler

     

    image.thumb.png.39d37cbb97270a49c5dd86087d84d53c.png

  10. So how do I create plugins with this new alpha build? Looking forward to having the latest C# features with the plugin Im creating. I get assembly reference conflicts with "WindowsBase.dll" where my plugin wants 5.0.0 and yours wants 4.6.0. 
    EDIT:
    I figured out how. See: 

     

  11. 15 hours ago, Ego Eram Reputo said:

     

    Render the image in the top left hand corner and make all the other pixels transparent.

    How do I do that? All I have to render a Bitmap is `CopyFromGdipBitmap` and `CopySurface` with `Surface.CopyFromBitmap`.
    I could choose the top left rendering point with `ImageRendererBgra` but as Rick said, that is an internal class I shouldn't use.
    Again, I can't do the x,y pixel coordinates due to the way the target format handles pixel coordinates.

×
×
  • Create New...