Jump to content
How to Install Plugins ×
Paint.NET 5.1 is now available! ×

Recommended Posts

Posted (edited)

TechnoRobbo'sTiled Pixels V1.2


Pixels become Shapes!


 


Menu: Effects->Stylize


 


TiledPixelsMenu.PNG?raw=1


simple controls - no instructions needed


 


 


TilePixels.png?raw=1


 


Vertigo


TilePixels2.png?raw=1


 


Vegas Baby


 


vegasbaby.png?raw=1


 


The Code


Really long so Click to see it


Hidden Content:


// Submenu: Stylize
// Name: TR's Tiled Pixels
// Title: TR's Tiled Pixels - v1.1
// Author: TechnoRobbo
// URL: http://www.technorobbo

#region UICode
int Amount1 = 16; // [10,100] Size
byte Amount2 = 0; // Shapes|Triangles|Envelopes|Diamonds|Stars|Hearts|Clubs(Clovers)|Spades
#endregion

void Render(Surface dst, Surface src, Rectangle rect)
{

Rectangle sel = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt();
//----------------------------------
Graphics g = new RenderArgs(dst).Graphics;
g.Clip =new Region(rect);
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None;
//BackGround-------------------------------
System.Drawing.SolidBrush BBrush = new System.Drawing.SolidBrush(System.Drawing.Color.Black);
g.FillRectangle(BBrush , new Rectangle(sel.Top, sel.Left,sel.Width,sel.Height));
BBrush.Dispose();
g.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceOver;
//===========================================================================================

System.Drawing.SolidBrush CBrush =new System.Drawing.SolidBrush(ColorBgra.Black);
System.Drawing.Pen CPen = new System.Drawing.Pen(CBrush ,1);
System.Drawing.Point[] pt = new System.Drawing.Point[0];


ColorBgra CP;
int inc = Amount1;
int shape = Amount2;
//Test Variable
//inc=50;
//shape=6;
//End Test
for (int y = sel.Top; y < sel.Bottom; y +=inc)
{
for (int x = sel.Left; x < sel.Right; x +=inc)
{
for (int altx=0; altx <2;altx++){
CP = src.GetBilinearSampleClamped(x + inc/2 * altx,y);
CBrush = new System.Drawing.SolidBrush(CP);
switch (altx + shape * 2)
{
case 0://triangle
pt = new System.Drawing.Point[3];
pt[0] = new System.Drawing.Point(x,y);
pt[1]= new System.Drawing.Point(x ,y+inc);
pt[2]= new System.Drawing.Point(x +inc, y + inc);
break;
case 1://triangle
pt = new System.Drawing.Point[3];
pt[0] = new System.Drawing.Point(x,y);
pt[1]= new System.Drawing.Point(x + inc,y );
pt[2]= new System.Drawing.Point(x +inc ,y+inc );
break;
case 2://envelope
pt = new System.Drawing.Point[3];
pt[0] = new System.Drawing.Point(x,y);
pt[1]= new System.Drawing.Point(x + inc/2 ,y+inc);
pt[2]= new System.Drawing.Point(x +inc, y);
break;
case 3://envelope
pt = new System.Drawing.Point[5];
pt[0] = new System.Drawing.Point(x,y + inc);
pt[1]= new System.Drawing.Point(x ,y );
pt[2]= new System.Drawing.Point(x + inc/2 ,y + inc);
pt[3]= new System.Drawing.Point(x + inc ,y );
pt[4]= new System.Drawing.Point(x + inc ,y + inc);
break;
case 4://diamond
pt = new System.Drawing.Point[4];
pt[0] = new System.Drawing.Point(x,y);
pt[1]= new System.Drawing.Point(x+inc ,y);
pt[2]= new System.Drawing.Point(x +inc, y + inc);
pt[3]= new System.Drawing.Point(x , y + inc);
break;
case 5://diamond
pt = new System.Drawing.Point[4];
pt[0] = new System.Drawing.Point(x + inc/2,y);
pt[1]= new System.Drawing.Point(x + inc,y + inc/2);
pt[2]= new System.Drawing.Point(x +inc/2 ,y+inc );
pt[3]= new System.Drawing.Point(x ,y+inc/2);
break;
case 6://star
pt = new System.Drawing.Point[4];
pt[0] = new System.Drawing.Point(x,y);
pt[1]= new System.Drawing.Point(x+inc ,y);
pt[2]= new System.Drawing.Point(x +inc, y + inc);
pt[3]= new System.Drawing.Point(x , y + inc);
break;
case 7://star
pt = new System.Drawing.Point[5];
pt[0] = new System.Drawing.Point(x + inc/2,y);
pt[1]= new System.Drawing.Point(x + inc,y + inc);
pt[2]= new System.Drawing.Point(x ,y+inc/3 );
pt[3]= new System.Drawing.Point(x +inc,y+inc/3);
pt[4]= new System.Drawing.Point(x,y+inc);
break;
case 8://heart
pt = new System.Drawing.Point[4];
pt[0] = new System.Drawing.Point(x,y);
pt[1]= new System.Drawing.Point(x+inc ,y);
pt[2]= new System.Drawing.Point(x +inc, y + inc);
pt[3]= new System.Drawing.Point(x , y + inc);
break;
case 9://heart
pt = new System.Drawing.Point[10];
pt[0] = new System.Drawing.Point(x + inc * 2/10,y + inc/10);
pt[1]= new System.Drawing.Point(x+inc*4/10 ,y+ inc/10);
pt[2]= new System.Drawing.Point(x + inc/2, y + inc*2/10);
pt[3]= new System.Drawing.Point(x + inc*6/10 , y + inc/10);
pt[4]= new System.Drawing.Point(x + inc*8/10 , y + inc/10);
pt[5] = new System.Drawing.Point(x + inc * 9/10,y + inc * 2/10);
pt[6]= new System.Drawing.Point(x + inc * 9/10,y + inc * 4/10);
pt[7]= new System.Drawing.Point(x + inc/2, y + inc*9/10);
pt[8]= new System.Drawing.Point(x + inc/10 , y + inc*4/10);
pt[9]= new System.Drawing.Point(x + inc/10 , y + inc*2/10);
break;
case 10://Clubs
pt = new System.Drawing.Point[4];
pt[0] = new System.Drawing.Point(x,y);
pt[1]= new System.Drawing.Point(x+inc ,y);
pt[2]= new System.Drawing.Point(x +inc, y + inc);
pt[3]= new System.Drawing.Point(x , y + inc);
break;
case 11://Clubs
pt = new System.Drawing.Point[26];
pt[0] = new System.Drawing.Point(x +inc*3/10,y+inc);
pt[1]= new System.Drawing.Point(x+inc*4/10 ,y +inc*9/10);
pt[2]= new System.Drawing.Point(x +inc*5/10, y + inc*6/10);
pt[3]= new System.Drawing.Point(x+inc*3/10 , y + inc*8/10);
pt[4]= new System.Drawing.Point(x+inc*2/10 , y + inc*8/10);
pt[5]= new System.Drawing.Point(x+inc/10 , y + inc*7/10);
pt[6]= new System.Drawing.Point(x+inc/10 , y + inc/2);
pt[7]= new System.Drawing.Point(x+inc*2/10 , y + inc*4/10);
pt[8]= new System.Drawing.Point(x+inc*3/10 , y + inc*4/10);
pt[9]= new System.Drawing.Point(x+inc*5/10 , y + inc*6/10);
pt[10]= new System.Drawing.Point(x+inc*3/10 , y + inc*3/10);
pt[11]= new System.Drawing.Point(x+inc*3/10 , y + inc*2/10);
pt[12]= new System.Drawing.Point(x+inc*4/10 , y + inc/10);
pt[13]= new System.Drawing.Point(x+inc*6/10 , y + inc/10);
pt[14]= new System.Drawing.Point(x+inc*7/10 , y + inc*2/10);
pt[15]= new System.Drawing.Point(x+inc*7/10 , y + inc*3/10);
pt[16]= new System.Drawing.Point(x+inc*5/10 , y + inc*6/10);
pt[17]= new System.Drawing.Point(x+inc*7/10 , y + inc*4/10);
pt[18]= new System.Drawing.Point(x+inc*8/10 , y + inc*4/10);
pt[19]= new System.Drawing.Point(x+inc*9/10 , y + inc*5/10);
pt[20]= new System.Drawing.Point(x+inc*9/10 , y + inc*7/10);
pt[21]= new System.Drawing.Point(x+inc*8/10 , y + inc*8/10);
pt[22]= new System.Drawing.Point(x+inc*7/10 , y + inc*8/10);
pt[23]= new System.Drawing.Point(x+inc*5/10 , y + inc*6/10);
pt[24]= new System.Drawing.Point(x+inc*6/10 , y + inc*9/10);
pt[25]= new System.Drawing.Point(x+inc*7/10 , y + inc);
break;
case 12://Spades
pt = new System.Drawing.Point[4];
pt[0] = new System.Drawing.Point(x,y);
pt[1]= new System.Drawing.Point(x+inc ,y);
pt[2]= new System.Drawing.Point(x +inc, y + inc);
pt[3]= new System.Drawing.Point(x , y + inc);
break;
case 13://Spades
pt = new System.Drawing.Point[15];
pt[0] = new System.Drawing.Point(x +inc*3/10,y+inc);
pt[1]= new System.Drawing.Point(x+inc*4/10 ,y +inc*9/10);
pt[2]= new System.Drawing.Point(x +inc*5/10, y + inc*6/10);
pt[3]= new System.Drawing.Point(x+inc*4/10 , y + inc*8/10);
pt[4]= new System.Drawing.Point(x+inc*2/10 , y + inc*8/10);
pt[5]= new System.Drawing.Point(x+inc/10 , y + inc*7/10);
pt[6]= new System.Drawing.Point(x+inc/10 , y + inc/2);
pt[7]= new System.Drawing.Point(x+inc/2 , y );
pt[8]= new System.Drawing.Point(x+inc*9/10 , y + inc/2);
pt[9]= new System.Drawing.Point(x+inc*9/10 , y + inc*7/10);
pt[10]= new System.Drawing.Point(x+inc*8/10 , y + inc*8/10);
pt[11]= new System.Drawing.Point(x+inc*6/10 , y + inc*8/10);
pt[12]= new System.Drawing.Point(x+inc*5/10 , y + inc*6/10);
pt[13]= new System.Drawing.Point(x+inc*6/10 , y + inc*9/10);
pt[14]= new System.Drawing.Point(x+inc*7/10 , y + inc);
break;
}//sw
if ( pt.Length!=0){ g.FillPolygon(CBrush,pt);}
}//altx
}//x
}//y
CBrush.Dispose();
g.Dispose();
}



TRsTiledPixels.zip

Edited by TechnoRobbo
  • Like 1
  • Upvote 2

Go out there and be amazing. Have Fun, TR
TRsSig.png?raw=1
Some Pretty Pictures Some Cool Plugins

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...