Jump to content

Ego Eram Reputo

Administrator
  • Posts

    14,567
  • Joined

  • Last visited

  • Days Won

    264

Posts posted by Ego Eram Reputo

  1. I have to agree. Positioning persistence for dialog windows would be a wonderful feature. Why not add your request to this thread for "settings" viewtopic.php?p=205290#p205290? [edit]Done - viewtopic.php?p=208474#p208474[/edit]

    Simon, I believe, has a bugged keyboard. It's happened to me before. Either than, or he's had one too many cold ones...
    No no no. He's just sitting more to the left than normal. See how he has transposed "I" for "O" in "other" and "S" for "A" in "hand"? :lol:
  2. Thank you all for your comments.

    @Geoff & david (re rotation); Yes I hear your request about rotating the frame. Unfortunately this feature adds a great deal of complexity to the plugin that I think is better handled by PDN itself. Not only would I have to include the frame rotation, but antialiasing the edges would be a must too. My recommendation follows from Ash's comment: put it on a separate layer and select/rotate that.

    @ david (re Text): This I could do, but again better handled by PDN. With users selecting different font and sizes there is always the risk of the text running off centre or worse, off the frame. I would have to limit the font size and text length to ensure this didn't happen :( I'm sure this would frustrate users in the long run.

    Those are only my immediate thoughts. If the requests keep coming through I might reconsider :wink:

  3. This little plugin arose from the Polaroid Collage tutorial. Specifically, this post:http://forums.getpaint.net/index.php?/topic/12300-polaroid-collage/page__view__findpost__p__203890, where the question was asked "...how did you make the original Polaroid frame?".

    Easy, you use the new Polaroid Frame plugin.

     

    Polaroid_Frame_Example.gif

     

    Polaroid Frame was really just an excuse to play with some of CodeLab's new UI controls (I just love the new Double Vector control) 8) The theory behind this plugin is that the frame and image are always a specific ratio of height vs. width. This is explained in my post here:http://forums.getpaint.net/index.php?/topic/12300-polaroid-collage/page__view__findpost__p__203897. This is why you only need one size control, because everything is linked to that size by a set ratio.

     

    The other controls are fairly self explanatory, except for maybe the checkboxes:

     

    Use Primary - Uses the primary color for the frame. Default is the secondary color.

    Develop Image - When checked, any underlying image will be shown in the frame. Unchecking this box will fill the image area with a brown color, like an undeveloped Polaroid!

    To install the plugin, download my Plugin Pack and unzip it. Run the *.exe installer (written by BoltBait). Restart paint.net.

    Enjoy!

     

  4. C# seems to be the language of choice (the transition from VB to C# is not too difficult). There are templates available if you have Visual Studio or one of the express packages installed:

    C# VS 2005: http://paintdotnet.forumer.com/viewtopic.php?f=27&t=2618

    VB.Net: http://paintdotnet.forumer.com/viewtopic.php?f=27&t=23004

    The fastest method to get started is to get CodeLab! Get it here

    I highly recommend working through the example scripts on BoltBaits web site to get you up and running.

  5. A scanner turns a "hardcopy" into an image which will have all the pixel data in the resultant file. So yes, you can edit the results. Provided the scanner outputs the image in a suitable file format (and not some strange "this model only" format).

    Look for file-save options that include *.GIF and *.JPG file formats (there are many others, but these two are common) and you will be able to load the images into PDN and play with them to your hearts content.

  6. A quick note on the correct dimensions & proportions of a polaroid. All of these dimensions use the image height as the reference size.

    Area of the image: Image height 100%, image width 97.5% (yes they are just taller than square)

    Area of the frame: Frame height 135%, frame width 110%.

    Border widths: Border-top 7.5%, border-bottom 27.5%, borders-left & right 5%.

    Setting your polaroid frame to these proportions will help the overall effect enormously.

  7. I'm having trouble with CodeLabs Double Vector UI control. I have pasted the sample UI code from BoltBaits website into CodeLab, but it generates an error when I build the *.dll.

    Here's the code I'm using....,

    /* ========================================================================== */
    /*                                                                            */
    /*   UI - Double Vector.cs                                                    */
    /*   Author: Curtis (via boltBaits Website)                                   */
    /*                                                                            */
    /*   Description:  How to use double Vector UI elements                       */
    /*                                                                            */
    /* ========================================================================== */
    
    #region UICode
    Pair Amount1=Pair.Create(0.0,0.0); // Position
    #endregion
    
    void Render(Surface dst, Surface src, Rectangle rect)
    {
      Rectangle selection = this.EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt();
      ColorBgra PrimaryColor = (ColorBgra)EnvironmentParameters.PrimaryColor;
    
      int width = selection.Right - selection.Left;
      int height = selection.Bottom - selection.Top;
    
      // converts the Pair values to between 0 and 1
      // where 0 is the left/top and 1 is the right/bottom.
      double px = (Amount1.First + 1) / 2;
      double py = (Amount1.Second + 1) / 2;
    
      // we can now convert these to actual pixel co-ordinates.
      int column = (int)Math.Round(px * width);
      int row = (int)Math.Round(py * height);
    
      for (int y = rect.Top; y    {
         for (int x = rect.Left; x       {
            if (x == column || y == row)
            {
               dst[x,y] = PrimaryColor;
            }
            else
            {
               dst[x,y] = src[x,y];
            }
         }
      }
    }

    And the error is.....,

    Error at line 119: Cannot implicitly convert type 'int' to 'PaintDotNet.Pair' (CS0029)

    [edit]

    Using the Interface Designer, I get this line, which works fine:

    Pair Amount1 = Pair.Create( 0.0 , 0.0 ); // Control Description

    But this one doesn't.

    Pair Amount2=Pair.Create(0.0,0.0); // Position

    Is the whitespace critical?

    [/edit]

  8. Hey there, heythere (sorry :D )

    Macros? Not exactly. I want to call (use) an existing PDN effect from within my new effect.

    Lets say I wanted to create a "snowstorm" effect to apply to photos (I don't - but now that I think about it..., :wink: ). I might use the effects "Add Noise" + "Blur"/"Motion Blur" to get the basic snow blobs on the canvas, before doing some other very cool stuff with these basic building blocks.

    I just wanted to know if this was achievable (it is) and how its done in CodeLab (see BoltBaits code - which uses GaussianBlurEffect).

  9. Thank you :!:

    I was looking at something that Simon Brown wrote here: http://paintdotnet.forumer.com/viewtopic.php?p=170913#p170913, but I just couldn't get it to work in CodeLab. Your source will help me an awful lot.

    I think you're really going to like the next version of CodeLab ;)

    You keep doing this to me :lol:. I dream up something and ask about it, and you say "Hang on, I'll make Codelab do that for you". Marvelous! Thank you!

  10. I want to create buttons for a website, where there is a small image in the background and a text above. Where the text is above the image, it shall have one color (white), where it's above the background it shall have another color.

    How do I do this the best way? (It should be easy to replace the text easily, because I need more buttons :)

    Hi, the best way (IMHO) to create multiple instances of the same basic button is:

      Create the background (=button) first.

      Next add new layers above the background, one for each different "text" you want stamped onto the button.

      Type in the text you want for each new layer, using the visibility checkbox(es) to toggle the layer(s) so that only the one you are working on is visible over the background.

      When you have all your text in place, you need to decide which way you want to have the colour change take place (there are many different ways to do this). One of the simplest is to alter the "blending" mode of the text layers - one by one. Whichever mode you employ, repeat it for each text layer.

    To save the buttons:

      First save the whole image as a *.pdn so that all the layers are preserved.

      Next toggle the text layers visibility so that only one shows above the background and save it in the file format of your choice (e.g. *.gif or *.jpg). you will need to "flatten" the image to complete the save.

      Once saved hit control+Z to undo the last change and the layers will magically reappear! Toggle the next text layer so it is the only one visible and repeat the save process.

      Repeat for each "button" you want to create.

    Hope this helps!

  11. I have the feeling the learning curve of understanding / working with VS, installing templates, understanding wich part of the files to change, edit, add, how all the blocks should work together seems to me as it will take a long time... (time I've problem to find...)

    Just to reiterate what Simon & BoltBait have said: Codelab builds *.dll's :D No Visual Studio required.

    I'll publish it anyway.

    Please do. The accepted way to insert you code is between "code" tags in a post. However if the code is really long you might want to attach it to your post as a file.

    Another question: could such a plugin be of any interest ?

    Almost certainly! I'm interested and I believe others will be too. Once you have your *.dll compiled, ZIP it with a 16x16 *.PNG icon of the same name and attach that to your post. Actually the icon is optional, but its nice to see your plugin loaded in PDN with your own icon beside it. 8)

  12. I am trying to write an effect that will average the colors of every pixel in the image/selection and fill the image/selection with that color.

             dst[x,y] = CurrentPixel;
         }
       }
     }
    
     // fill out selection with average color
     for (int y = rect.Top; y   {
       for (int x = rect.Left; x     {
         if (selectionRegion.IsVisible(x, y))
         {
           dst[x,y] = GlobalClass.AverageColor;
    

    I've had a quick look at your code and cannot escape the conclusion that you're writing twice to the destination canvas. In the code quote above see the first and last lines? Both seem to dump a value into dst[x,y]. Is this required, or what you desire? The second "write" will always overwrite the first.

    p.s. I wouldn't have even understood anything I wrote above even a week ago without the great help of people on the forums and the openness of effects writers. Thanks, all!

    Welcome aboard! Despite having released a few meagre plugins, I'm just a beginner myself :wink: I'm sure the wise heads here will be able to point you in the right direction.

  13. Feature Request: Since CodeLab forces an Amount1, Amount2, etc for UI Elements, could you please include a find and replace feature? This would be extremely helpful for when dealing with reording of the UI Elements. Thanks!

    Mike have you seen PSPad? Have a look at this: http://www.pspad.com

    I use this to do most of the "grunt" work (like cutting and pasting code from other source files - as you can open multiple files at once). Then I call up CodeLab to polish my code (& make it run - hopefully :roll: ). I generally start with an effect template (heavily commented) which tells me how to use the new UI features in CodeLab, so I don't have to keep logging on to figure them out :!:

    Note: As CodeLab becomes more powerful I am using it more and more to write entire effects, but as you have noticed it has no find & replace (yet...,).

    Just a thought...,

  14. Thanks Ego Eram Reputo for supplying sample code for this control on this page: http://www.boltbait.com/pdn/codelab/hel ... html#Fonts

    That might be my code :wink: , but the idea to draw directly to the canvas using drawing routines definitely came from MadJik when he and I were discussing a plugin which later became Random Mazes: http://paintdotnet.forumer.com/viewtopic.php?p=148303#p148303.

    MadJik used g.DrawLine to draw the walls of his maze and I adapted this to work with g.DrawString. I would not have figured this out by myself and simply ran with his idea.

  15. CodeLab 1.1 has been released.

    And a wonderful upgrade it is too :!:

    I can't thank you enough BoltBait, particularly for the Drop-Down List Box and the BlendOp controls. I'm gonna have so much fun with these :D

    [edit]

    I was wondering if any of the controls can be set dynamically? Specifically the drop-down listbox. Can I populate the list at *.dll runtime (say with a list of fonts gleaned from the users PC)?

    [/edit]

×
×
  • Create New...