Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners plsz i want the coding details of line

Have Programming Question? Ask it here!
 
 
 


arivu
plsz i want the coding details of line
0 Answer(s)      9 months ago
Posted in : Java Beginners


package vc.api;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.image.BufferedImage;
import java.io.File;
import java.util.Random;
import javax.imageio.ImageIO;
import vc.controller.Controller;

/**
 *
 1. @author ????
 */
public class VCAPI {
    private static BufferedImage pic1;
    private static BufferedImage pic2;
    private static BufferedImage out;

  static int getBrightness(int rgb) {
    int r,g,b;
    Color pixColour = new Color(rgb);
    r=pixColour.getRed();
    g=pixColour.getGreen();
    b=pixColour.getBlue();
    rgb = (int)((r+g+b)/3);
    return rgb;
  }

  static BufferedImage monochrome(BufferedImage picture) {
    int i,j,min=128,max=128,value=0,col;

    for (i=0;i<picture.getHeight();i++){
      for (j=0;j<picture.getWidth();j++) {
        value=getBrightness(picture.getRGB(j,i));
        if (value<min) min=value;
        if (value>max) max=value;
      }
    }

    value=(int)Math.ceil((max+min)/2);

    for (i=0;i<picture.getHeight();i++){
      for (j=0;j<picture.getWidth();j++) {
        col=getBrightness(picture.getRGB(j,i));
        if (col<value) picture.setRGB(j,i,-16777216);//black
        else picture.setRGB(j,i,-1);//white
      }
    }

    return picture;
  }

  static BufferedImage meldImages(BufferedImage template, BufferedImage random) {
    int i,j;
    BufferedImage output = new BufferedImage(template.getWidth(),template.getHeight(),BufferedImage.TYPE_INT_RGB);

    for (i=0;i<template.getHeight();i++){
      for (j = 0; j < template.getWidth(); j++) {


 2. **if (template.getRGB(j,i)<-8388608) {//black if
    (random.getRGB(j,i)<-8388608)
    output.setRGB(j,i,-1); else
    output.setRGB(j,i,-16777216);**

        }
        else {
          if (random.getRGB(j,i)<-8388608) output.setRGB(j,i,-16777216);
          else output.setRGB(j,i,-1);
        }
      }
    }
    return output;
  }
//------------------------------------------------------------------------------
  static BufferedImage makeGrey(BufferedImage template) {//note; 0 is black in the top left corner, 1 has white in that corner
    BufferedImage output = new BufferedImage(template.getWidth()*2,template.getHeight()*2,BufferedImage.TYPE_INT_RGB);
    int i,j;

    for (i=0;i<template.getHeight();i++){
      for (j=0;j<template.getWidth();j++) {
        if (template.getRGB(j,i)<-8388608) {//black
          output.setRGB((j*2),(i*2),-16777216);//black
          output.setRGB((j*2),(i*2)+1,-1);//white
          output.setRGB((j*2)+1,(i*2),-1);//white
          output.setRGB((j*2)+1,(i*2)+1,-16777216);//black
        }
        else {
          output.setRGB((j*2),(i*2),-1);//white
          output.setRGB((j*2),(i*2)+1,-16777216);//black
          output.setRGB((j*2)+1,(i*2),-16777216);//black
          output.setRGB((j*2)+1,(i*2)+1,-1);//white
        }

      }
    }
    return output;
  }

in the above code i want details about the valule...in meldimage() function ....we can see the for loop...

that is

if (template.getRGB(j,i)<-8388608) {//black if
    (random.getRGB(j,i)<-8388608)
    output.setRGB(j,i,-1); else
    output.setRGB(j,i,-16777216);

getRGB(j,i)<-8388608

why can put this value?
its default value ?
or if its any value of rgb

second setRGB(j,i,-16777216) y can use this value...its constant one

how 2 get this value...
plsz explain this code....its come visual cryptography grayconversion coding 

plsz anybody helpme..for this code

what is use of this value?
why can check < -8388608?
how to got this value -8388608
plsz helpme

i want this coding details plsz friends helpme..

Advertisement
View Answers

Related Tutorials/Questions & Answers:
plsz i want the coding details of line
plsz i want the coding details of line  package vc.api; import...? how to got this value -8388608 plsz helpme i want this coding details plsz... want details about the valule...in meldimage() function ....we can see
plsz i want the coding details of line
plsz i want the coding details of line  package vc.api; import... i want this coding details plsz friends helpme... output; } in the above code i want details about the valule
Advertisements
how i want to create a coding by this question?
how i want to create a coding by this question?  Design and write a class named Person and its two subclasses named Student and Employee. Make Lecturer and Admin subclasses of Employee. A person has a name, address, phone number
Login coding for gettin friends details
Login coding for gettin friends details  login codin in servlet?   Please visit the following link: Login Application
i want to find the byte code of a image file ... for my project..plz if anybody help me for java coding i will grateful..
i want to find the byte code of a image file ... for my project..plz if anybody help me for java coding i will grateful..   i want to convert... project.. but i cant convert Image file to its byte code format.. if anybody can plz
problem i coding
problem i coding  i have a problem in coding a combobox containing a number of *.java program on click one of them that program should compile and run and display the result in other window
i want to learn Jquery
i want to learn Jquery  i want to learn jquery can u plz guide me   Yes, you can learn these technologies by yourself. Go through the following links: Ajax Tutorials JSON Tutorials JQuery Tutorials
i want for statement codding
i want for statement codding  what is the for condition following out put 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5
I want this jsp answers
I want this jsp answers    How can we declare third party classes and interfaces inside our jsp page? How can we declare and definr global variables... for particular jsp pages? If we want to develop any jsp pages using eclipse where we can
I want this jsp answers
I want this jsp answers    How can we declare third party classes and interfaces inside our jsp page? How can we declare and definr global variables... for particular jsp pages? If we want to develop any jsp pages using eclipse where we can
i want code for these programs
i want code for these programs   Advances in operating system Laboratory Work: (The following programs can be executed on any available and suitable platform) Design, develop and execute a program using any
I want solution for this jsp program..
I want solution for this jsp program..   <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@ page import="java.sql.*" %> JSP Page <%! String
I am getting error.How can i get details
I am getting error.How can i get details  Exception in thread "main" java.sql.SQLException: Listener refused the connecti n with the following error: ORA-12505, TNS:listener does not currently know of SID given in connect
i want to create dynamic calendar in java
i want to create dynamic calendar in java  i want code and explanation
i want to create dynamic calendar in java
i want to create dynamic calendar in java  i want code and explanation
i want display integer number in a string of statement
i want display integer number in a string of statement  i want display integer number in a string of statement
I want to learn Hibernate tutorial quickly
I want to learn Hibernate tutorial quickly  Hello, I want to learn Hibernate tutorial quickly. Is there any way.. I want to learn Hibernate online.. Please help
I want detail information about switchaction? - Struts
I want detail information about switch action?  What is switch action in Java? I want detail information about SwitchAction
same thing i want but from db..
same thing i want but from db..  http://www.roseindia.net/tutorial/javascript/dynamicCombo.html same thing i want but from db
How do i do the coding for 'leaving a comment' in java
How do i do the coding for 'leaving a comment' in java  i am designing a webpage.In my webpage i want to add the option of adding a comment by the readers of the page.how do i do
i want print the following out put
i want print the following out put  Hello sir i want the following out put can u provide the program in c# o/p; HELLOLLEH HELLLEH HELEH HEH H
i want to pass Javascript value to JSP scriptlet..
i want to pass Javascript value to JSP scriptlet..  i am having a problem that, i am having a combo box in the JSP page when i select an item from... now i want to pass this value to JSP scriptlet
i want immediate code - Development process
i want immediate code  Basic sales tax is applicable at a rate of 10... of 5%, with no exemptions. When I purchase items I receive a receipt which lists... an application that prints out the receipt details for these shopping baskets... INPUT
i want to remove specific node in xml file
i want to remove specific node in xml file   <A> <B>hi <C>by <A> <B>hellow <C>how r u ? i want to delet node which is == hellow using java program please help me . tanks in advance
i want 2 columns to be deleted in mysql
i want 2 columns to be deleted in mysql  i want 2 columns to be deleted in mysql The tables having the columns have no mapping   Use the given query: ALTER TABLE table_name DROP col_name
I want complete tutorial on advanced java
I want complete tutorial on advanced java  I am studying advanced java like servlets, JSP's RMI EJB's JDBC & all stuff like this i want some tutorial file so that i can download it & read can anyone help me?   
i want to display where i entered values to same page
i want to display where i entered values to same page  hi friends !! i have a values from jsp page .and i want to store that values into DB at the same time i want to show immediatlly on same jsp page with tabular format
i want to display where i entered values to same page
i want to display where i entered values to same page  hi friends !! i have a values from jsp page .and i want to store that values into DB at the same time i want to show immediatlly on same jsp page with tabular format
I want code below mention programe
I want code below mention programe  Create a web application using any technology that accepts a keyword and displays 10 relevant tweets from Twitter in real-time for that keyword
I want design samples for JSP project
I want design samples for JSP project  Sir, I world Like to do a project in jsp techonology. But i have no idea of selecting the project, especially if i selected any project i have no idea that is how to build ie how to design
I want to learn hibernate step-by-step.
I want to learn hibernate step-by-step.  Hello, I am very new to programming world and I am looking forward to learn Hibernate, but I would like to start from start and learn it step by step. Can you please help me.. I would
i want to know how a slide will hide
i want to know how a slide will hide  when im click on the button then im getting a slide, but when im click on the another button this slide will be hide.. and here im using logic iterate to getting the values from action class
i want to know how a slide will hide
i want to know how a slide will hide  when im click on the button then im getting a slide, but when im click on the another button this slide will be hide.. and here im using logic iterate to getting the values from action class
How can i write a datagrid coding - Java Beginners
How can i write a datagrid coding  Hi, I want make a datagrid..plz send me datagrid coding using mysql database and jsp..plz tell me brief description about grid how can i connect datagrid with database. Thanks
help i want it now the answer pleas...
help i want it now the answer pleas...  write a program that will display the exactly output as below: Hints: declare and initialize value of array in double type.Read and write all elements of array.perform the multiply
please i want someone to answer me pleeeeeeeeeeeeease...
please i want someone to answer me pleeeeeeeeeeeeease...    Write a JAVA program using 2D array to auto-grade exams. For a class of N students, your program should read letter answers (A, B, C, D) for each student. Assume
I am from .net background, I want to learn SOA.
I am from .net background, I want to learn SOA.  Hi I am from .net background, I want to learn SOA. Could it possible for me to learn SOA, I suppose SOA includes Java. I dont have knowledge of java. Please help Thanks  
How can i draw a line using java swings
How can i draw a line using java swings  Sir my program contains different components i am using JFrame. I want to draw a straight line between components(Jtextfeilds, Jlabels).So could you help me for it. Thank You
How can i draw a line using java swings
How can i draw a line using java swings  Sir my program contains different components i am using JFrame. I want to draw a straight line between components(Jtextfeilds, Jlabels).So could you help me for it. Thank You
i want to create an icon on my desktop... with this i want to open my web application
i want to create an icon on my desktop... with this i want to open my web application  i want to create an icon on my desktop... with this i want to open my web application(automatically run my server... )how
i want to resize the tiff file also - WebSevices
i want to resize the tiff file also  if($objFiles['photo']['name']!="") { $objFiles['photo']['name']=str_replace(" ","_",$objFiles['photo']['name']); $FileName= time().$objFiles['photo']['name']; $this->resize_image
i want to save image on server folder. and i want to save URL of this folder and name of image in database
i want to save image on server folder. and i want to save URL of this folder and name of image in database  hi i want to save image on server folder. and i want to save URL of this folder and name of image in database.on click
when I run exiting project that time I got error, I want solution on it?
when I run exiting project that time I got error, I want solution on it? .../apache/commons/lang3/StringUtils. Please see server.log for more details... log for details. BUILD FAILED (total time: 1 minute 20 seconds
Java I/O From the Command Line
Java I/O From the Command Line In this section we will learn about the I/O from the command line in Java. Several times you can see that the programs runs after taking the input from the command line. Java also supports for the command
i want to display where i entered values to same page
i want to display where i entered values to same page  hi friends !! i have a values from jsp page .and i want to store that values into DB at the same time i want to show immediatlly on same jsp page with tabular format
how can i draw line between two panel contaning circle and line between their center?
how can i draw line between two panel contaning circle and line between their center?   how can i draw line between two panel contaning circle and line between their center
How can I execute a PHP script using command line?
How can I execute a PHP script using command line?  How can I execute a PHP script using command line
How can i display the distance of a line drawing randomly?
How can i display the distance of a line drawing randomly?  How can i display the distance of a line drawing randomly
can i estimate estimate execution time for a method without knowing implementation details of a method - Java Interview Questions
can i estimate estimate execution time for a method without knowing implementation details of a method  hi all, can i estimate estimate execution time for a method without knowing implementation details of a method. Thanks
How can i read a file from nth line onwards in java
How can i read a file from nth line onwards in java  Hi, I need to read a file content from its nth line onwards till end. How can i implement it in java. Regards, Chinnu
Advertisements
 

 

 

DMCA.com