For smart Primates & ROBOTS (oh and ALIENS ).

Thursday, March 12, 2015

HOW TO MAKE TRANSPARENT PNG FILE IN C# VB.NET .NET

Problem:

I was working a project where watermark in pdf file as text. but after some time requirement has been changed. the requirement is put watermark as png file in pdf instead of text. The first task was generate transparent png file in C# with given text. the text should be show diagonal. listed below the few lines of code.
HOW TO MAKE TRANSPARENT PNG FILE IN C#





















Solution:

See the below code:

Example:

string text = " this is diognal text for watermark in transparent png file";
Bitmap bmp = new Bitmap(400, 800);
int x = 200, y = 400, angle=55;
Graphics g = Graphics.FromImage(bmp);
System.Drawing.Font f = new System.Drawing.Font("Arial", 25, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Pixel);
g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit;
g.Clear(Color.Transparent);
g.TranslateTransform(x, y);
g.RotateTransform(-angle);
g.TranslateTransform(-x, -y);
SizeF size = g.MeasureString(text, f);
g.DrawString(text, f, Brushes.Black, new PointF(x - size.Width / 2.0f, y - size.Height / 2.0f));
bmp.Save("test.png", System.Drawing.Imaging.ImageFormat.Png);
g.Dispose();
 
Share:

PDF Water Marker

If you have a PDF with one page or more than one page and want to insert an image as a water mark in that PDF file then you can use this my software. Your are free to use this product.

PDF Water Marker














Before run this application you need to install .Net Framework 4.5

Download PDF Water Marker Here
Share:

GET MAC ADDRESS IN C# VB.NET

Problem:

Some time you want to develop a software in C# or Vb.net that will run only on specific computer system. for this you use mac address of that system.

Solution:

Here the C# code that will fetch mac address.

Example:

System.Net.NetworkInformation.NetworkInterface[] nic= System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces();
String macAddress = string.Empty;
foreach (System.Net.NetworkInformation.NetworkInterface ni in nic)
{
   System.Net.NetworkInformation.IPInterfaceProperties properties=ni.GetIPProperties();
   macAddress = ni.GetPhysicalAddress().ToString();
   if (macAddress != String.Empty) {
                        MessageBox.Show(macAddress);
                        return;
   } 

}



Share:

SHOW FORM WITH IN FORM AS IMAGE


Problem:

Some time you have already created many form. then are opening separately when you click on any button in MDI Form or separate in C# winform.  After soe time requirement has changed. the new requirement is to open new form in the same form from where you are clicking button.
For better understand see below image

Show Form with in form as image

















Solution:


Use panel control to show form 


Example:

panel1.Visible = true;
panel1.Controls.Clear();
StandardTest f1 = new StandardTest(); // this the form which you want to show
f1.TopLevel = false;
panel1.Controls.Add(f1);
panel1.Width = 1100;
panel1.Height = 620;
f1.Width = 1100;
f1.Height = panel1.Height - 0;
f1.Dock = DockStyle.Left;
f1.Show();



Share:

Adding text in PDF File at specific position Freeware Software

Suppose you have a PDF file; which have one or more than one page and you want to insert text at the specific position. then in this situation you need to use PDF editor and goto each page and put the text at the position where you want. but if the pdf file is having 100 or more pages then it will difficult to edit it. in this condition you can use this my software.

If will make these task very easy, you need to input pdf file, text which you want to see and enter the X and Y position and click Apply button.


Adding text in PDF File at specific position Freeware Software

















It will insert the text at the position which you have supplied in all the pages. To execute this software you need to Microsoft Framework 4.0 or later.

Download Adding text in PDF File at specific position Software





Share:

Web page screen capture as image









Web page screen capture as image















Download Web Page Screen Capture as Image









Share:

TORCH IN ANDROID



If Torch in your mobile is not existing then download this Android App and you will get torch in your android mobile.


DOWNLOAD TORCH IN ANDROID HERE
Share:

reCAPTCHA

Google has improvement it's captcha and introduced new reCAPTCHA


reCAPTCHA 















Follow below steps to implement reCAPTCHA:

1- Sign up google reCAPTCHA site:
http://www.google.com/recaptcha/intro/index.html

2- Register your site domain. after thar it will give you "site key" and "secret key"

ON CLIENT SITE:

1- Paste this line in your web page.
<script src='https://www.google.com/recaptcha/api.js'></script>

2- Paste the <div> tag as same in reCaptcha site:
<div class="g-recaptcha" data-sitekey="YOUR-SITE-KEY"></div> 

ON SERVER SITE:

1-  Send three variable as POST method to url  
https://www.google.com/recaptcha/api/siteverify

Post variable are: secret, response, remoteip
where secret is the your Secret Key
response is recaptcha
remoteip is your remote ip address

//CHECK reCAPTCHA in PHP code
$g_r_r=$POST['g-recaptcha-response'];
if(!empty($g_r_r) && strlen($g_r_r)>0) { 
  $gurl="https://www.google.com/recaptcha/api/siteverify";
  $scrt='YOUR-SECRET KEY';
  $my_ip=$_SERVER['REMOTE_ADDR'];
  $url=$gurl."?secret=".$
scrt."&response=".$g_r_r."&remoteip=".$my_ip;
  
  $c = curl_init();
  curl_setopt($c, CURLOPT_URL, $url);
  curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($c, CURLOPT_TIMEOUT, 30);
  curl_setopt($c, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.16) Gecko/20110319 Firefox/3.6.16");

  $c_data = curl_exec($c);
  curl_close($c);
  $res= json_decode($c_data , true);
  if($res['success']>=1) {
    //IMPLEMENT HERE LOGIN LOGIC OR ANY OTHER LOGIC
  }
}
Share:

Wednesday, March 11, 2015

HOW TO REMOVE BLOGGER WORD IN BLOG

Problem:

If you have a blog in blogger. then you can see "blogger" word at the bottom of page or any where in the blog. if you don't need this then how can you remove this?

Solution:

You just need copy and past listed below code at the end of blog.

Example:

<script type='text/javascript'>
function r_p() {
var r_place_s=&quot;Blogger&quot;;
var r_place_t=&quot;Galaxy Code&quot;;
var Attribution1=document.getElementById(&quot;Attribution1&quot;);
var Attribution1_html=Attribution1.innerHTML;
var regex = new RegExp( &#39;(&#39; + r_place_s + &#39;)&#39;, &#39;gi&#39; );
Attribution1.innerHTML=Attribution1_html.replace( regex, r_place_t );
}
Share:

BAR AND QR CODE READER IN ANDROID

Bar and QR code reader/scanner in android
This android app will read Bar code and QR code. It is based on zxing, so after install it download zxing. it will automatically detect zxing in you mobile. if not found then ask you about to download automatically.



BAR AND QR CODE READER IN ANDROID
















Download it from here
BAR AND QR CODE READER IN ANDROID
Share:

Ads Inside Post

Powered by Blogger.

Archive