Sign in to follow this  
TechnoRobbo

TR's Tiled Pixels V1.2

Recommended Posts

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
  • Upvote 1

Share this post


Link to post
Share on other sites

Ya think I would have changed the name of slider #1. It's actually "Pixel Increments" but I will probably call it  "Size". Sorry. I will correct and repost. I may add more shapes too as long as I'm reposting.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this