xod

Members
  • Content count

    358
  • Joined

  • Last visited

  • Days Won

    9

xod last won the day on January 14

xod had the most liked content!

Community Reputation

193

1 Follower

About xod

  • Rank
    2016 Music Guru
  • Birthday 12/10/1968

Profile Information

  • Gender
    Male
  • Location
    RO

Recent Profile Visitors

1,814 profile views
  1. CodeLab and PDN crash if we modify the version as in the image and try to build the dll.
  2. Unfinished plugins

    This is an object alignment plugin made with CodeLab. It's very slow for big canvases because of the algorithm. // Name: Alignment // Submenu: // Author: xod // Title: Alignment // Version: 1.0 // Desc: Align the object on the canvas or in selection // Keywords: // URL: // Help: #region UICode RadioButtonControl Amount1 = 1; // [0]|Center|Top Left|Bottom Left|Top Right|Bottom Right|Middle Left|Middle Right|Middle Top|Middle Bottom|Left|Middle Horizontal|Right|Top|Middle Vertical|Bottom|Cancel (Initial position) #endregion void Render(Surface dst, Surface src, Rectangle rect) { Rectangle sel = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); ColorBgra CurrentPixel; int sTop = sel.Top; int sBot = sel.Bottom; int sLeft = sel.Left; int sRite = sel.Right; int centX = sel.Width/2; int centY = sel.Height/2; int x = 0; int y = 0; int x1 = 0; int x2 = 0; int y1 = 0; int y2 = 0; int xPos = 0; int yPos = 0; bool fp1 = false; bool fp2 = false; bool fp3 = false; bool fp4 = false; { // sTop //find y1 ************************ _________________________________ for (y = sTop; y < sBot; y++) // | | | { // | | | for (x = sLeft; x < sRite; x++)// | | | { // | |y1 | CurrentPixel = src[x,y];// | | | if(CurrentPixel.A != 0) // | _|_ | { // | x1 | | x2 | fp1 = true; // sLeft|--------|Obj|-------------------|sRite y1 = y; // | |___| | break; // | | | } // | |y2 | if (fp1) break; // | | | } // |__________|_____________________| } // sBot //find y2 ************************ for (y = sBot - 1; y > sTop; y--) { for (x = sLeft; x < sRite; x++) { CurrentPixel = src[x,y]; if(CurrentPixel.A != 0) { fp2 = true; y2 = y + 1; break; } if (fp2) break; } } //find x1 ************************ for (x = sLeft; x < sRite; x++) { for (y = sTop; y < sBot; y++) { CurrentPixel = src[x,y]; if(CurrentPixel.A != 0) { fp3 = true; x1 = x; break; } if (fp3) break; } } //find x2 ************************* for (x = sRite - 1; x > sLeft; x--) { for (y = sTop; y < sBot; y++) { CurrentPixel = src[x,y]; if(CurrentPixel.A != 0) { fp4 = true; x2 = x + 1; break; } if (fp4) break; } } //********************************** switch (Amount1) { case 0: //Center xPos = (sLeft - x1 + centX) - (x2 - x1)/2; yPos = (sTop - y1 + centY) - (y2 - y1)/2; break; case 1: //Top Left xPos = sLeft - x1; yPos = sTop - y1; break; case 2: //Bottom Left xPos = sLeft - x1; yPos = sBot - y2; break; case 3: //Top Right xPos = sRite - x2; yPos = sTop - y1; break; case 4: //Bottom Right xPos = sRite - x2; yPos = sBot - y2; break; case 5: //Middle Left xPos = sLeft - x1; yPos = (sTop - y1 + centY) - (y2 - y1)/2; break; case 6: //Middle Right xPos = sRite - x2; yPos = (sTop - y1 + centY) - (y2 - y1)/2; break; case 7: //Middle Top xPos = (sLeft - x1 + centX) - (x2 - x1)/2; yPos = sTop - y1; break; case 8: //Middle Bottom xPos = (sLeft - x1 + centX) - (x2 - x1)/2; yPos = sBot - y2; break; case 9: //Left xPos = sLeft - x1; yPos = sTop-sTop; break; case 10: //Middle Horizontal xPos = (sLeft - x1 + centX) - (x2 - x1)/2; yPos = sTop-sTop; break; case 11: //Right xPos = sRite - x2; yPos = sTop-sTop; break; case 12: //Top xPos = sLeft - sLeft; yPos = sTop - y1; break; case 13: //Middle Vertical xPos = sLeft - sLeft; yPos = (sTop - y1 + centY) - (y2 - y1)/2; break; case 14: //Bottom xPos = sLeft - sLeft; yPos = sBot - y2; break; case 15: //Cancel (Initial position) xPos = sLeft - sLeft; yPos = sBot - sBot; break; } } Bitmap bmp = new RenderArgs(src).Bitmap; Graphics g = new RenderArgs(dst).Graphics; g.Clip = new Region(rect); g.Clear(Color.Transparent); g.DrawImage(bmp, xPos, yPos); bmp.Dispose(); g.Dispose(); dst[0,0] = dst[0,0]; } Alignment.zip
  3. Yes, it works very well, thanks for your help.
  4. It's about that kind of situation:
  5. Thank you MJW. For more complex situations like the one in the picture below I tried to create a new cond2 condition, but it does not work. object[] cond1 = new object[] {Amount9Options.Amount9Option2, Amount9Options.Amount9Option5, Amount9Options.Amount9Option8}; propRules.Add(new ReadOnlyBoundToValueRule<object, StaticListChoiceProperty>(PropertyNames.Amount10, PropertyNames.Amount9, cond1, true)); propRules.Add(new ReadOnlyBoundToValueRule<object, StaticListChoiceProperty>(PropertyNames.Amount11, PropertyNames.Amount9, cond1, true)); object[] cond2 = new object[] {Amount9Options.Amount9Option3, Amount9Options.Amount9Option6}; propRules.Add(new ReadOnlyBoundToValueRule<object, StaticListChoiceProperty>(PropertyNames.Amount10, PropertyNames.Amount9, cond2, true))
  6. Thanks, but it does not work. I suppose otherwise code is needed.
  7. I tried this but only when I select the last one =7 the slider it's enabled.
  8. If I have a dropdown list with 8 options and I want to enable a slider when only 3 options (not necessarily one after another) from that dropdown list is choosed, how can I make that?
  9. Ok, thanks for the answer and for your work.
  10. I do not know if anyone else noticed this, but CodeLab 2.24 does not correctly pinpoint the errors. Is that how it should behave? Older versions accurately mark the error. https://i.imgur.com/2qz9PTB.png
  11. grid plugin

    Another plugin: GuideLines.zip
  12. ImageInText

    Updated according to Eli's request.
  13. This plugin is based on toe_head2001 Text Window plugin code. Found in Effects ► Text Formations submenu: ► ImageInText.zip ◄
  14. For shine you need Gradient tool.