Jump to content

midora

Members
  • Posts

    1,535
  • Joined

  • Last visited

  • Days Won

    19

Posts posted by midora

  1. Untested, just looking in the repo. Add to the override Render method

     

    // Get the current settings from the token (or do it in OnSetRenderInfo)

    Amount1 =

    Amount2 =

     

    // Render each rectangle

    for (int index = startIndex; index < startIndex + length; ++index)

        Render(dstArgs.Surface, srcArgs.Surface, rois[index]);

     

    But you should really start  with a more simple project. There is too much overhead in this one.

     

  2. Your override of the Render method doesn't render anything. To create a virtual OnRender method makes only sense if you like to override it (and the loop there executes an empty statement). So add the loop with a call to the second Render method to the first one. Take the surfaces from the RenderArgs. I'm not adding a code snippet now.

  3. That's a little bit strange because the Windows FileExplorer shows it like the third image. And I guess the the FileExplorer uses also WIC. Maybe icm is not enabled. paint.net 4.2.16 and the 4.3 beta shows it like the second one, which seems to be fine. And the What's it plugin identifies it as jpeg 😉

     

    I have to correct the first sentence. It only gets the green touch on my second monitor on the main one it looks fine.

  4. By mistake I figured out that the rule 'paint.net does only load an image if the image filename has the correct extension' is not always true.

     

    Renaming a .jpg to .bmp still loads the file. I guess this is the case because both extension use WIC to decode the file and WIC identifies the file by content and not by extension.

     

    We will not tell this users 😉

     

  5. You missed the point that women should stay at home and shouldn't get any education.

     

    There are good reasons why most countries removed god from their constitutions and tell religion is something private which is protected.

     

    I don't know how the situation is outside of Switzerland but here exist two types of marriage. One by the state and one by the religion. The one by the state is just about that two decide that they share responsibility for each other. The religions can decide if they are accepting mixed couples. My one does and also allows women to be priest. I guess it's the same in other European countries.

     

    Still if all countries would share the same basic measurement units then life would be easier. Who cares if there are local additions.

     

     

  6. I started developing of some new plugins beginning of the year and got redraw issues (some issues I reported in the 'callout selection' plugin).

    I retested the plugins using the beta and the issues are gone. I will now change the plugin code to .net 5.

     

  7. Cultural identity is an important thing to keep local people together but it also creates borders to others. So IMHO we have to think about what's really important and not just something we are used to.

     

    On 9/18/2021 at 5:21 AM, IHaveNoName said:

    Incredibly those imperial measurements units are understood even by millennials and post millennials

     

    But if something is part of your daily life then this is not a big surprise.

    You would also adjust if the signs would shown km for a period of 40 years.

    Is a mile a natural distance between anything? If not then there is no difference to km.

     

    Just yesterday there was a message about a new TV from LG. The size is 325 inches. I can not imagine this amount of inches.

     

    There are no EU overloards. There is a union of countries which share common values, try to solve issues peacefully, and show solidarity.

     

  8. 1 hour ago, Red ochre said:

    The E.U. must be a terrible place now judging by the number of migrants trying to escape across the English channel.☹️

     

    They are coming because their English is better than mine ,-)

    Yeah, it's sometimes a disadvantage to be the homeland of a language which people are using worldwide. Not like German or French.

    Still you should be happy that there is the French channel.

     

    In Swizerland we are using Deziliter (tenth of a liter) to measure bear. Everything is small.

     

    At the end let's see what the UK goverment decides. And as I remember it was not forbidden to add imperial units but a must to use metric. Which make sense in a global world. So maybe it will be now vice versa.

     

    And for sure i noticed the death Sir Sinclair (independent of my potential programming skills, others have to  judge this ;-).

    So RIP Clive.

    But I'm much more interested to see what's going on in the future and not in the past.

     

    'Evil empire E.U.' that's really funny. That's worth an up-vote.

     

    • Haha 1
  9. 1 hour ago, Tito said:

    I use the rotate and zoom tool on layers, but it's really hard to use it with trackballs. It's too imprecise to do a flip on an image

     

    Typically it's easier to use the numeric controls to fine-tune the effect. But as @Pixeymentioned sometimes it's better to use a perspective plugin (depending on the effect you like to achieve).

  10. New tools, new challenges, more fun 😉

    I remember when I first had to use this machine to create holes on cards to program the computer on university. Just 40 years have been passed and nowadays we are fighting with gigabits of data per second in mobile communication and still trying to debug and understand what's going on there.

  11. As @null54said. It looks like that you placed your whole project inside of the paint.net folder.

    You should locate it somewhere outside of paint.net folders and just copy the plugin dll from the output folder to the Effect folder using a post-build command.

    It's standard that VS copies your dll and all dependencies and .pdb into the output folder.

     

     

    • Thanks 1
  12. No complains about unsafe code in plugins? 😉

     

    I put the code in an extension method for Surfaces.

     

    Spoiler

            public unsafe static void FromRasterBGRA(this Surface surface, byte[] rasterBGRA)
            {
                int width = surface.Width;
                int height = surface.Height;
                fixed (byte* rasterPtr = rasterBGRA)
                {
                    int row = 0;
                    long srcStride = width * 4;
                    var srcPtr = rasterPtr;
                    var srcRasterEndPtr = srcPtr + srcStride * height;
                    while (srcPtr < srcRasterEndPtr)
                    {
                        var dstPtr = surface.GetRowPointerUnchecked(row);
                        System.Buffer.MemoryCopy(srcPtr, dstPtr, srcStride, srcStride);
                        srcPtr += srcStride;
                        row++;
                    }
                }
            }

     

     

    Pointer operations are fast compared to for loops. If the stride is small then they are beating method calls because of the overhead.

    Sometimes your raster is not in BGRA order. This can be handled easily using pointers.

     

    Still I would like to avoid unsafe code at this level.

    So surface methods to copy from/to part of a row would be great. I.e.

     

    void CopyToRow(byte[] src, long srcOffset, int row, int column, int length);

    void CopyFromRow(byte[] dst, long dstOffset, int row, int column, int length);

     

    void CopyToRow(uint[] src, long srcOffset, int row, int column, int columns);

    void CopyFromRow(uin[] dst, long dstOffset, int row, int column, int columns);

     

    or for a whole raster

     

    void CopyToImage(byte[] src, int srcStride);

    void CopyFromImage(byte[] dst, int dstStride);

     

    void CopyToImage(uint[] src, int srcStride);

    void CopyFromImage(uint[] dst, int dstStride);

     

    Sorry that I have to use spoilers instead of code sections but I'm tired to wait that it opens here (and most of the time it fails).

     

  13. Assuming there is a pixel array containing all pixels of the image in BGRA top-left to bottom-right order. There are many surface methods (let's exclude the obsolete one) which may be helpful. So what's the proposed way for filetype plugins.

     

    Is unsafe code acceptable (like the following).

     

    Spoiler

            unsafe void SurfaceFromRasterBGRA(Surface surface, byte[] rasterBGRA)
            {
                int width = surface.Width;
                int height = surface.Height;
                fixed (byte* rasterPtr = rasterBGRA)
                {
                    int row = 0;
                    var srcPtr = (uint*)rasterPtr;
                    var srcRastercEndPtr = srcPtr + width * height;
                    while (srcPtr < srcRastercEndPtr)
                    {
                        var srcRowEndPtr = srcPtr + width;
                        var dstPtr = (uint*)surface.GetRowPointerUnchecked(row);
                        while (srcPtr < srcRowEndPtr)
                        {
                            *dstPtr++ = *srcPtr++;
                        }
                        row++;
                    }
                }

            }

     

    is the surface data locked during the operation or is there the potential risk of a crash.

     

    I would prefer to use a paint.net method to copy from/to a raster but I didn't find a good method.

     

     

     

     

  14. Thanks for the effort @null54. I just found the topic about the Treatment. Then I looked for Treatment in the registry and found

    HKEY_CLASSES_ROOT\SystemFileAssociations\image
        Key: Treatment Value: 2  (means Photo Border)

    Then I checked the .pdn entry and found

        Key: PerceivedType Value: image

    And that's it. Setting this key to .bmrl shows the drop shadow after a restart of the FileExplorer.

    That's what I expected in the beginning: There must be a kind of file category marker.

    Now I have to figure out how do do this using the sharpshell library. Maybe I have to patch it...

     

×
×
  • Create New...