Wednesday, May 4, 2011

Using Custom Fonts

By Magesh Kumar   Posted at  3:13 AM   Android No comments

Lastly we’re going to examine the process of using custom fonts. We’ll use this font for demonstration purposes. Download it and place the TTF file in the ./assets directory (create it if it doesn’t exist yet).


We’re going to use a basic layout file with a TextView, marked with an id of “custom_font” so we can access it in our code.
<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

              android:orientation="vertical"

              android:layout_width="fill_parent"

              android:layout_height="fill_parent"

        >

 

    <TextView

            android:id="@+id/custom_font"

            android:layout_width="fill_parent"

            android:layout_height="wrap_content"

            android:text="This is the Chantelli Antiqua font."

            />

 

</LinearLayout>


Open your main activity file and insert this into the onCreate() method:
TextView txt = (TextView) findViewById(R.id.custom_font);

        Typeface font = Typeface.createFromAsset(getAssets(), "Chantelli_Antiqua.ttf");

        txt.setTypeface(font);

Go to top of page

By Magesh Kumar   Posted at  3:05 AM   Java Scripts No comments

<!-- START OF Watermark Jump to Top Link DHTML -->


<!-- SUMMARY BRIEF

          This DHTML script will put a small watermark
          link in the bottom right corner of your page
          that will stay there even when the page scrolls.
          This link will always take the user back to
          the top of the page.

-->


<!-- Put this portion of the script inside of your <HEAD> tag -->


<script>
<!--

// Change this text to the text that you want to be displayed as the link on your page.

var displayed="<nobr><font size=2 face=Arial><b>[Top]</b></font></nobr>"

// === DO NOT EDIT ANYTHING BELOW THIS LINE!!! === //

var logolink='javascript:window.scrollTo(0,0)'
var ns4=document.layers
var ie4=document.all
var ns6=document.getElementById&&!document.all

function regenerate(){
window.location.reload()
}
function regenerate2(){
if (ns4)
setTimeout("window.onresize=regenerate",400)
}

if (ie4||ns6)
document.write('<span id="logo" style="position:absolute;top:-300;z-index:100">'+displayed+'</span>')

function createtext(){ //function for NS4
staticimage=new Layer(5)
staticimage.left=-300
staticimage.document.write('<a href="'+logolink+'">'+displayed+'</a>')
staticimage.document.close()
staticimage.visibility="show"
regenerate2()
staticitns()
}

function staticit(){ //function for IE4/ NS6
var w2=ns6? pageXOffset+w : document.body.scrollLeft+w
var h2=ns6? pageYOffset+h : document.body.scrollTop+h
crosslogo.style.left=w2
crosslogo.style.top=h2
}

function staticit2(){ //function for NS4
staticimage.left=pageXOffset+window.innerWidth-staticimage.document.width-28
staticimage.top=pageYOffset+window.innerHeight-staticimage.document.height-10
}

function inserttext(){ //function for IE4/ NS6
if (ie4)
crosslogo=document.all.logo
else if (ns6)
crosslogo=document.getElementById("logo")
crosslogo.innerHTML='<a href="'+logolink+'">'+displayed+'</a>'
w=ns6? window.innerWidth-crosslogo.offsetWidth-20 : document.body.clientWidth-crosslogo.offsetWidth-10
h=ns6? window.innerHeight-crosslogo.offsetHeight-15 : document.body.clientHeight-crosslogo.offsetHeight-10
crosslogo.style.left=w
crosslogo.style.top=h
if (ie4)
window.onscroll=staticit
else if (ns6)
startstatic=setInterval("staticit()",100)
}

if (ie4||ns6){
window.onload=inserttext
window.onresize=new Function("window.location.reload()")
}
else if (ns4)
window.onload=createtext

function staticitns(){ //function for NS4
startstatic=setInterval("staticit2()",90)
}

//-->
</script>

<!-- END OF Watermark Jump to Top Link DHTML -->

Calculator script

By Magesh Kumar   Posted at  2:59 AM   Java Scripts No comments

<!-- A Simple Calculator -->
<!-- Instructions: Just put this script anywhere on your webpage
          between the body tags and you will have a calculator for your visitors!  -->
<CENTER>

<FORM name="Keypad" action="">
<TABLE>
<B>
<TABLE border=2 width=50 height=60 cellpadding=1 cellspacing=5>
<TR>
<TD colspan=3 align=middle>
<input name="ReadOut" type="Text" size=24 value="0" width=100%>
</TD>
<TD
</TD>
<TD>
<input name="btnClear" type="Button" value="  C  " onclick="Clear()">
</TD>
<TD><input name="btnClearEntry" type="Button" value="  CE " onclick="ClearEntry()">
</TD>
</TR>
<TR>
<TD>
<input name="btnSeven" type="Button" value="  7  " onclick="NumPressed(7)">
</TD>
<TD>
<input name="btnEight" type="Button" value="  8  " onclick="NumPressed(8)">
</TD>
<TD>
<input name="btnNine" type="Button" value="  9  " onclick="NumPressed(9)">
</TD>
<TD>
</TD>
<TD>
<input name="btnNeg" type="Button" value=" +/- " onclick="Neg()">
</TD>
<TD>
<input name="btnPercent" type="Button" value="  % " onclick="Percent()">
</TD>
</TR>
<TR>
<TD>
<input name="btnFour" type="Button" value="  4  " onclick="NumPressed(4)">
</TD>
<TD>
<input name="btnFive" type="Button" value="  5  " onclick="NumPressed(5)">
</TD>
<TD>
<input name="btnSix" type="Button" value="  6  " onclick="NumPressed(6)">
</TD>
<TD>
</TD>
<TD align=middle><input name="btnPlus" type="Button" value="  +  " onclick="Operation('+')">
</TD>
<TD align=middle><input name="btnMinus" type="Button" value="   -   " onclick="Operation('-')">
</TD>
</TR>
<TR>
<TD>
<input name="btnOne" type="Button" value="  1  " onclick="NumPressed(1)">
</TD>
<TD>
<input name="btnTwo" type="Button" value="  2  " onclick="NumPressed(2)">
</TD>
<TD>
<input name="btnThree" type="Button" value="  3  " onclick="NumPressed(3)">
</TD>
<TD>
</TD>
<TD align=middle><input name="btnMultiply" type="Button" value="  *  " onclick="Operation('*')">
</TD>
<TD align=middle><input name="btnDivide" type="Button" value="   /   " onclick="Operation('/')">
</TD>
</TR>
<TR>
<TD>
<input name="btnZero" type="Button" value="  0  " onclick="NumPressed(0)">
</TD>
<TD>
<input name="btnDecimal" type="Button" value="   .  " onclick="Decimal()">
</TD>
<TD colspan=3>
</TD>
<TD>
<input name="btnEquals" type="Button" value="  =  " onclick="Operation('=')">
</TD>
</TR>
</TABLE>
</TABLE>
</B>
</FORM>
</CENTER>
<font face="Verdana, Arial, Helvetica" size=2>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var FKeyPad = document.Keypad;
var Accumulate = 0;
var FlagNewNum = false;
var PendingOp = "";
function NumPressed (Num) {
if (FlagNewNum) {
FKeyPad.ReadOut.value  = Num;
FlagNewNum = false;
   }
else {
if (FKeyPad.ReadOut.value == "0")
FKeyPad.ReadOut.value = Num;
else
FKeyPad.ReadOut.value += Num;
   }
}
function Operation (Op) {
var Readout = FKeyPad.ReadOut.value;
if (FlagNewNum && PendingOp != "=");
else
{
FlagNewNum = true;
if ( '+' == PendingOp )
Accumulate += parseFloat(Readout);
else if ( '-' == PendingOp )
Accumulate -= parseFloat(Readout);
else if ( '/' == PendingOp )
Accumulate /= parseFloat(Readout);
else if ( '*' == PendingOp )
Accumulate *= parseFloat(Readout);
else
Accumulate = parseFloat(Readout);
FKeyPad.ReadOut.value = Accumulate;
PendingOp = Op;
   }
}
function Decimal () {
var curReadOut = FKeyPad.ReadOut.value;
if (FlagNewNum) {
curReadOut = "0.";
FlagNewNum = false;
   }
else
{
if (curReadOut.indexOf(".") == -1)
curReadOut += ".";
   }
FKeyPad.ReadOut.value = curReadOut;
}
function ClearEntry () {
FKeyPad.ReadOut.value = "0";
FlagNewNum = true;
}
function Clear () {
Accumulate = 0;
PendingOp = "";
ClearEntry();
}
function Neg () {
FKeyPad.ReadOut.value = parseFloat(FKeyPad.ReadOut.value) * -1;
}
function Percent () {
FKeyPad.ReadOut.value = (parseFloat(FKeyPad.ReadOut.value) / 100) * parseFloat(Accumulate);
}
// End -->
</SCRIPT>

Monday, May 2, 2011

Cracks

By Magesh Kumar   Posted at  2:18 AM   Photoshop No comments


1.Open an image for applying the cracks to.

2. Double click the Lasso Tool on the tool bar to select the Tool and to bring up the Lasso Options. Make sure Anti-Aliased is Uncheckedand feather is set to 0. This is so we know it will be nice and sharp and no smoothing or soft edges.

3. Make a New Layer. On the image now, jiggle the mouse and make a crack of some sort with the lasso. You’ll need to start at one point and then eventually return to that same point (like shown). This takes a little artistic skill from you to make a really cool one. So if you don’t like the first try, then hit undo.

4. After you have made a crack design, fill it with 100% white by using the paint brush or going to Edit>Fill and choosing White.

5. Offset the selection one pixel up and then to the left one pixel using the arrow keys on the keyboard.

6. Fill the selection with Dark Gray. Now choose "Hard Light" from the layers pop down menu. 

You can Deselect it now by going toSelect>Deselect.



7.To add the hollow look, go toLayer>Effects>Inner Shadow. If you don’t want this look, then fill with Black instead of Dark Gray on step 6.




8. This next step we will be adding some details to the cracks. Zoom into an area. Paint some Highlights above the crack and a dark shadow below the crack like I have shown, this makes it looked popped out a little. You will need to be creative and artistic, try and play around a little bit.


Chipped Type

By Magesh Kumar   Posted at  2:08 AM   Photoshop No comments



1
Create a new image, and use the Type Tool  to create some text. If you are using Photoshop 5.0 or later, right click on the T icon on the text layer, and select Render Layer. 

Next, holding down
 Ctrl, click on the text layer to select it's transparency. 

Press
 Q on the keyboard to enter Quick Mask Mode.
2
Press
 Ctrl+I to invert the mask. 

Now, in the menu go:
Filter > Pixelate > Crystallize...
 

Crystallize by
 10 pixels, and hit OK.
3
In the menu, select:
Image > Adjust > Brightness/Contrast...
 

Drag the Contrast slider to
 96, and Brightness to -75 and hit OK. 

Press
 Q, on the keyboard, to exit Quick Mask Mode. 

In the menu, go:
 Edit > Clear 
Deselect
 Ctrl+D. 

Back to top ↑
Connect with Us

What they says

© 2013 MaGeSH 2 help. WP Mythemeshop Converted by BloggerTheme9
Blogger templates. Proudly Powered by Blogger.