Jump to content

Recommended Posts

  • 2 weeks later...

^^ Love it! Seriously nice job.

Link to post
Share on other sites
2 hours ago, Eli said:

...Some trapezoid distortions would be also nice.:) 

 

 

Rotate / Zoom can do this. Also some plug-ins, such as Perspective Transformation, Quadrilateral Correction that runs much faster.

Edited by xod
  • Like 1
Link to post
Share on other sites
  • 2 weeks later...
4 hours ago, xod said:

but I don't know how to transfer the drawing to the pdn surface.

 

To create a Surface from the Bitmap:

bmpSurface = Surface.CopyFromBitmap(token.WorkBMP);

 

Note: the new Surface will have the same dimensions as the Bitmap.

 

If the Bmp Surface has the same dimensions as the Dst Surface, you can just do do this:

dstArgs.Surface.CopySurface(source, rois, startIndex, length);

 

If the two Surfaces have different dimensions, then you'll have to use something like GetBilinearSample():

            if (length == 0) return;
            for (int i = startIndex; i < startIndex + length; ++i)
            {
                for (int y = rois[i].Top; y < rois[i].Bottom; y++)
                {
                    if (IsCancelRequested) return;
                    for (int x = rois[i].Left; x < rois[i].Right; x++)
                    {
                        dstArgs.Surface[x, y] = bmpSurface.GetBilinearSample(x, y);
                    }
                }
            }

 

  • Upvote 3
Link to post
Share on other sites
  • 2 weeks later...

I don't know why my shapes are surrounded by white pixels.

 

LyIL2OD.png

 

 

 

Bitmap wrkbmp = new Bitmap(WorkBMP.Width, WorkBMP.Height);
WorkBMP.DrawToBitmap(wrkbmp, WorkBMP.ClientRectangle);

//make transparent
wrkbmp.MakeTransparent(wrkbmp.GetPixel(0, 0));

ShapesTool.zip

Edited by xod
Link to post
Share on other sites
  • 3 months later...

I don't have time to download and look through the code, but I think HyReZ is on the right track. It looks like the line is being antialiased against a white background, then the modified pixels are copied onto a transparent background. The white outline consists of pixels with partial coverage.  Since I don't know what you're doing, I can't say exactly what's happening, but I suspect it's something similar.

Link to post
Share on other sites

I can't say how to fix it, but I do think that adding a threshold value to determine which pixels gets transparent should answer your problem.

 

x<threshold_value ? 0 : x

 

The above is what I thought on how to solve it. If it just a plain color, then it should return a plain color instead of original x image.

Edited by Reptillian
Link to post
Share on other sites
  • 3 weeks later...

This 'ImageDistortion' plugin has been designed to be used with 'TextDistortion'.

Can be found in the Effects ► Distort submenu.

 

 

 

 

Edited by xod
Replace with new version.
  • Like 2
  • Upvote 2
Link to post
Share on other sites
Link to post
Share on other sites
  • 2 months later...

This is an experimental plugin.
You need the two OptionBasedLibrary v0.7.9 files.


You can place it where you want by editing the Align+.dlc file.
In order to do that you need to change the extension to .txt

Open it with Notepad and edit the line:
AlignEffectPlugin.SubmenuName=your choise
Save and change the extension to .dlc

 

6OkvgBv.png

 

AlignPlus.zip

Edited by xod
Replaced with new version.
  • Like 2
  • Upvote 1
Link to post
Share on other sites

This is nice @xod, but it overwrites the one you wrote with @MJW, which I use all the time.

The coding needs to reflect that you are calling it 'Align+'.

Thanks!  :)

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...