John Scott
-
Posts
6 -
Joined
-
Last visited
Posts posted by John Scott
-
-
4.3.2 works much better - we'll be sticking to that one until we move to VS 2022.
These are the warnings I get with that.
6>------ Build started: Project: GameTexFileType, Configuration: Release Any CPU ------ entVersion.targets(2203,5): warning MSB3277: Found conflicts between different versions of "WindowsBase" that could not be resolved. entVersion.targets(2203,5): warning MSB3277: There was a conflict between "WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" and "WindowsBase, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35". entVersion.targets(2203,5): warning MSB3277: "WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" was chosen because it was primary and "WindowsBase, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" was not. entVersion.targets(2203,5): warning MSB3277: References which depend on "WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" [C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\5.0.0\ref\net5.0\WindowsBase.dll]. entVersion.targets(2203,5): warning MSB3277: C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\5.0.0\ref\net5.0\WindowsBase.dll entVersion.targets(2203,5): warning MSB3277: Project file item includes which caused reference "C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\5.0.0\ref\net5.0\WindowsBase.dll". entVersion.targets(2203,5): warning MSB3277: C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\5.0.0\ref\net5.0\WindowsBase.dll entVersion.targets(2203,5): warning MSB3277: References which depend on "WindowsBase, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" []. entVersion.targets(2203,5): warning MSB3277: C:\Program Files\paint.net\PaintDotNet.Base.dll entVersion.targets(2203,5): warning MSB3277: Project file item includes which caused reference "C:\Program Files\paint.net\PaintDotNet.Base.dll". entVersion.targets(2203,5): warning MSB3277: PaintDotNet.Base entVersion.targets(2203,5): warning MSB3277: PaintDotNet.Core entVersion.targets(2203,5): warning MSB3277: PaintDotNet.Data entVersion.targets(2203,5): warning MSB3277: C:\Program Files\paint.net\PaintDotNet.Core.dll entVersion.targets(2203,5): warning MSB3277: Project file item includes which caused reference "C:\Program Files\paint.net\PaintDotNet.Core.dll". entVersion.targets(2203,5): warning MSB3277: PaintDotNet.Core entVersion.targets(2203,5): warning MSB3277: PaintDotNet.Data entVersion.targets(2203,5): warning MSB3277: C:\Program Files\paint.net\PaintDotNet.SystemLayer.dll entVersion.targets(2203,5): warning MSB3277: Project file item includes which caused reference "C:\Program Files\paint.net\PaintDotNet.SystemLayer.dll". entVersion.targets(2203,5): warning MSB3277: PaintDotNet.Core entVersion.targets(2203,5): warning MSB3277: PaintDotNet.Data entVersion.targets(2203,5): warning MSB3277: C:\Program Files\paint.net\PaintDotNet.Framework.dll entVersion.targets(2203,5): warning MSB3277: Project file item includes which caused reference "C:\Program Files\paint.net\PaintDotNet.Framework.dll". entVersion.targets(2203,5): warning MSB3277: PaintDotNet.Data entVersion.targets(2203,5): warning MSB3277: C:\Program Files\paint.net\PaintDotNet.SystemLayer.Native.x64.dll entVersion.targets(2203,5): warning MSB3277: Project file item includes which caused reference "C:\Program Files\paint.net\PaintDotNet.SystemLayer.Native.x64.dll". entVersion.targets(2203,5): warning MSB3277: PaintDotNet.Core entVersion.targets(2203,5): warning MSB3277: PaintDotNet.Data 6>GameTexFileType -> D:\RUSTY-GPEG\Encoder\GameTex\Binaries\DotNET\Release\net5.0\GameTexFileType.dll
Warnings make my skin crawl - especially those I don't know how to fix. It seems dotnet5 depends on WindowsBase 4, but PDN is based on dotnet5 that depends on WindowsBase 5?
Cheers
John -
Greetings. Getting rid of x86 and less than Windows 10 seems very sensible. However, moving to Dotnet6 is causing me problems. I have a plugin to load a custom filetype which unfortunately no longer compiles.
The error is:CSC : error CS1705: Assembly 'PaintDotNet.Data' with identity 'PaintDotNet.Data, Version=4.304.8007.42994, Culture=neutral, PublicKeyToken=null' uses 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' which has a higher version than referenced assembly 'System.Runtime' with identity 'System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
In the interest of saving everyone time, where can I download the most recent version of Paint.NET that used Dotnet5?
Dotnet6 is still in preview, so I don't wish to move everything over just yet (even if Visual Studio would let me). I'm still not entirely sure why Dotnet5 (which I can't replicate atm) gave me a warning but Dotnet6 gives me an error.
Anyway, keep up the great work - I've been using PDN for years and it's never let me down. It also has the sweetest update process of any software.
CheersJohn
-
Worked a treat - thanks!
Cheers
John
-
DirectBitmap is in the StackOverflow link. Even older code is commented out.
Thanks!private void AddLayer( Document mippedDocument, int8 mip, int32[] image, FGameTexHeader header, int32 widthInBlocks, int32 heightInBlocks ) { // Copy the data to a bitmap int32 width = widthInBlocks * header.BlockWidth; int32 height = heightInBlocks * header.BlockHeight; // https://stackoverflow.com/questions/24701703/c-sharp-faster-alternatives-to-setpixel-and-getpixel-for-bitmaps-for-windows-f DirectBitmap bitmap = new DirectBitmap(header.MaxWidth, header.MaxHeight); // Bitmap bitmap = new Bitmap( header.MaxWidth, header.MaxHeight, PixelFormat.Format32bppArgb ); for ( int32 y = 0; y < height; y++ ) { for (int32 col = 0; col < width; ++col) { bitmap.SetPixel(col, y, Color.FromArgb(image[y * width + col])); } // Rectangle area = new Rectangle( 0, y, width, 1 ); // BitmapData pixel_data = bitmap.LockBits( area, ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb ); // Marshal.Copy( image, y * width, pixel_data.Scan0, width ); // bitmap.UnlockBits( pixel_data ); } // Copy the bitmap to a Paint.NET layer Surface mip_surface = Surface.CopyFromBitmap(bitmap.GetBitmap(), false ); // Surface mip_surface = Surface.CopyFromBitmap(bitmap, false); BitmapLayer mip_layer = new BitmapLayer( mip_surface ); mip_layer.Name = "Mip " + mip; mip_layer.Visible = ( mip == 0 ); mip_layer.BlendMode = LayerBlendMode.Normal; mip_layer.Opacity = 255; mippedDocument.Layers.Add( mip_layer ); bitmap.Dispose(); }
-
I have a custom image format that I've had a Paint.NET plugin to view for about 4 years now. Unfortunately, with moving to Net5, it no longer compiles. Is there source for a sample plugin using the latest and greatest to load an image out there?
Alternatively, given and int32[] of RGBA pixels, how would I convert that to a BitmapLayer (to add to a document)?
I'm sorry to ask something so simple, but I'm having no luck with my google-fu
CheersJohn
WindowsBase version conflict when building PDN 4.3 plugins
in Plugin Developer's Central
Posted
I too am running into this - with Net6 and VS2022
I have not found a good solution at all - the best bet seems to be to ignore the warning (which is never a good idea)
Enabling WPF/WinForms (which I don't need) seems less than ideal.
I was speculating a binding redirect would help, but the csproj does not seem to like it. https://stackoverflow.com/questions/43365736/assembly-binding-redirect-how-and-why
...or even trying it automatically - https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/how-to-enable-and-disable-automatic-binding-redirection
Cheers
John