Jump to content

The Sanctuary


Rubrica

Recommended Posts

Really?

[syntax lang=csharp" filename="useless.cs]

public void Useless()

{

String hi = "o";

MessageBox.Show(hi);

}[/syntax]

std::cout << "Hello world";

(message "Hello World")

echo sprintf("Hello, %s", $name);

This text is bold!

hello.prototype.world = function()
{
alert("Hello world!");
}

,.+.+.+.+.+.+.+.+.+.

All shows up green to me.

KaHuc.png
Link to comment
Share on other sites

The only problem of using the syntax highlighter is that all text following your code is rendered smaller than normal. (Small price to pay, I'm thinkin') :D

You just surround your code with [syntax lang=csharp" filename="useless.cs] tags.

According to the web site, here are the supported languages (including some we might use around here):

Supported Syntaxes: abap, actionscript, actionscript3, ada, apache, applescript, apt_sources, asm, asp, autoit, avisynth, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_mac, caddcl, cadlisp, cfdg, cfm, cil, cmake, cobol, cpp, cpp-qt, csharp, css, d, dcs, delphi, diff, div, dos, dot, eiffel, email, erlang, fo, fortran, freebasic, genero, gettext, glsl, gml, gnuplot, groovy, haskell, hq9plus, html4strict, idl, ini, inno, intercal, io, java, java5, javascript, kixtart, klonec, klonecpp, latex, lisp, locobasic, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, make, matlab, mirc, modula3, mpasm, mxml, mysql, nsis, oberon2, objc, ocaml, ocaml-brief, oobas, oracle11, oracle8, pascal, per, perl, php, php-brief, phpbb, pic16, pixelbender, plsql, povray, powershell, progress, prolog, properties, providex, python, qbasic, rails, rebol, reg, robots, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, tcl, teraterm, text, thinbasic, tsql, typoscript, vb, vbnet, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xhtml, xml, xorg_conf, xpp, z80

Click to play:
j.pngs.pngd.pnga.pngp.png
Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game

Link to comment
Share on other sites

So, let me ask you... does it bother you so much that you'd give up the forum feature?

I hacked together an alternative that converts C#, C++ and VB.NET to BBCode with syntax colouring using the library you mentioned:

http://www.isimonbrown.co.uk/syncol/

The main problem with it is that I can't find a way to indent things in BBCode outside of

 tags.
KaHuc.png
Link to comment
Share on other sites

You could include a transparent gif used as a spacer.

BTW, your page had some issues.

// Author: BoltBait

// Submenu: Photo

// Name: Combined Adjustments

// URL: http://www.BoltBait.com/pdn

// Title: BoltBait\'s Photo Adjustments v1.1

#region UICode

double Amount1 = 0.2; // [0,1] Noise Reduction

int Amount2 = -10; // [-100,100] Brightness

int Amount3 = 10; // [-100,100] Contrast

int Amount4 = 1; // [-10,10] Yellow Blue

int Amount5 = 5; // [-100,100] Saturation

int Amount6 = 30; // [0,100] Final Multiply Adjustment

#endregion

// Setup for using the various blend ops

private UserBlendOps.MultiplyBlendOp multiplyOp = new UserBlendOps.MultiplyBlendOp();

private UnaryPixelOps.HueSaturationLightness saturationOp;

// Rick, stop moving stuff around!

private byte Clamp2Byte(int iValue)

{

if (iValue

if (iValue>255) return 255;

return (byte)iValue;

}

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

{

Rectangle selection = this.EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt();

saturationOp = new UnaryPixelOps.HueSaturationLightness(0, 100+Amount5, 0);

// Setup for calling the Noise Reduction function

ReduceNoiseEffect noiseEffect = new ReduceNoiseEffect();

PropertyCollection nProps = noiseEffect.CreatePropertyCollection();

PropertyBasedEffectConfigToken nParameters = new PropertyBasedEffectConfigToken(nProps);

nParameters.SetPropertyValue(ReduceNoiseEffect.PropertyNames.Radius, 10);

nParameters.SetPropertyValue(ReduceNoiseEffect.PropertyNames.Strength, Amount1);

noiseEffect.SetRenderInfo(nParameters, new RenderArgs(dst), new RenderArgs(src));

// Call the Reduce Noise function

noiseEffect.Render(new Rectangle[1] {rect},0,1);

// Setup for calling the Brightness and Contrast function

BrightnessAndContrastAdjustment bacAdjustment = new BrightnessAndContrastAdjustment();

PropertyCollection cProps = bacAdjustment.CreatePropertyCollection();

PropertyBasedEffectConfigToken cParameters = new PropertyBasedEffectConfigToken(cProps);

cParameters.SetPropertyValue(BrightnessAndContrastAdjustment.PropertyNames.Brightness, Amount2);

cParameters.SetPropertyValue(BrightnessAndContrastAdjustment.PropertyNames.Contrast, Amount3);

bacAdjustment.SetRenderInfo(cParameters, new RenderArgs(dst), new RenderArgs(dst));

// Call the Brightness and Contrast function

bacAdjustment.Render(new Rectangle[1] {rect},0,1);

// Now in the main render loop, the dst canvas has a fixed up version of the src canvas

for (int y = rect.Top; y

{

ColorBgra* srcPtr = src.GetPointAddressUnchecked(rect.Left, y);

ColorBgra* dstPtr = dst.GetPointAddressUnchecked(rect.Left, y);

for (int x = rect.Left; x

{

// Boost the saturation

*dstPtr = saturationOp.Apply(*dstPtr);

// Yellow-Blue adjustment

ColorBgra SourcePixel = *dstPtr;

SourcePixel.R = Clamp2Byte(SourcePixel.R - Amount4/2);

SourcePixel.G = Clamp2Byte(SourcePixel.G - Amount4/2);

SourcePixel.B = Clamp2Byte(SourcePixel.B + Amount4);

*dstPtr = SourcePixel;

// Finally, add a little \"punch\" to the overall picture

ColorBgra DestPixel = *dstPtr;

DestPixel.A = (byte)(int)(Amount6 * 255.0 / 100.0);

*dstPtr = multiplyOp.Apply(*dstPtr, DestPixel);

srcPtr++;

dstPtr++;

}

}

}

As you can see on the multiplyOp definition line (near the top) there is an extra set of characters whenever the "new" keyword is used. Also, single and double quotes are escaped.

One nice thing the [syntax] tags provide is a download button.

Click to play:
j.pngs.pngd.pnga.pngp.png
Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game

Link to comment
Share on other sites

*ahemcoughcoltssuperbowlcough*

:D

Indeed. :-) An awesome Colts/Saints super bowl. Can't wait. :-)
You should get the Win7 theme for XP. Then get the rest of Win7. Then uninstall XP. Then it'll really look nice. ~ David Atwell
Indeed. :-) I forgot about that.

 

The Doctor: There was a goblin, or a trickster, or a warrior... A nameless, terrible thing, soaked in the blood of a billion galaxies. The most feared being in all the cosmos. And nothing could stop it, or hold it, or reason with it. One day it would just drop out of the sky and tear down your world.
Amy: But how did it end up in there?
The Doctor: You know fairy tales. A good wizard tricked it.
River Song: I hate good wizards in fairy tales; they always turn out to be him.

Link to comment
Share on other sites

Happiness: My order for the Mass Effect 2 Collector's Edition Guide and Game have been shipped. Can't wait to play it. :D

---- Gallery | Sig Tutorial | deviantART | Sig Videos | PhotoBucket ----

D                  E                  S                  T                  I                 N                  Y

Link to comment
Share on other sites

Happiness: Enjoying my new forum rank! :)

Same here. :D

Thanks BoltBait!

---- Gallery | Sig Tutorial | deviantART | Sig Videos | PhotoBucket ----

D                  E                  S                  T                  I                 N                  Y

Link to comment
Share on other sites

Congrats again, DarkShock. I think you deserve that title not only because of your talent but because of the sheer number of sigs you've created. :D

Happiness: I have 6.5 Gb free space on my hard drive now. It isn't that much, but sure beats 120 Mb. :lol:

Hatred does not cease by hatred, but only by love; this is the eternal rule.
|fb(page)|portfolio|blog|

Link to comment
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...