Showing posts with label design. Show all posts
Showing posts with label design. Show all posts

Sunday, 29 November 2015

Resolution independent GUI- Java Tutorial

Hello everyone, I am back with more exciting design tutorials that will really help you to develop a desktop application. In the previous tutorial I have provided java code for developing a simple login page GUI. In this tutorial I am going to explain that how we can achieve the resolution independency using Dimension class in java which is a prebuild library.  The reason of this tutorial is to make our application resolution independent i.e. we will execute our application on low resolution systems even if it is developed on high resolution systems  It will  So let's start.

Step 1: As usual you need the design ready with you using Adobe photoshop. This time you need not to define any specific size of size because we will make it resolution independent. I have used this picture as background, you can choose or create your own as you will be known to the software very much, I Hope SO.

Step 2: Next step is to start creating Jframe with some components as shown below:
  1. JLabel
  2. ImageIcon
  3. Image
An additional class this time is the Dimension class which I have initialized in class as well:
"Dimension d=Toolkit.getDefaultToolkit().getScreenSize();"
This is the class that will make a difference in our previous codes where could not accessed resolution of our screen but here we will retrieve the resolution of the screen from the object we have created i.e. d. We can make it as follows:
Frame.setBounds(0,0,d.width,d.height);
Look's easy right!

Step 3:
Once we have got the components and resolution of the screen we can start our remaining short code by filling the Jlabel with the image with the help oh ImageIcon object. But it is not a scalable icon. If you directly use image as icon to Jlabel then you will get the background but not the independency on other computers. For that purpose we have used Image class as follows for grabbing the image:

backI = ImageIO.read(new File("F:/Pics/SUCCESS.jpg"));        

This line belongs to image acquisition form disk and below is the code snippet to scale the image to adjust the reolution mapping to image. This is an automatic scaling.

backI = backI.getScaledInstance(back.getWidth(), back.getHeight(),Image.SCALE_REPLICATE);
That's the code explanation that how we will make a resolution independent GUI in java. With the help of these you can develop any type of application for any resolution system. Here is the complete code:

import java.awt.*;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;
import javax.swing.*;


public class Resolution_independent {
   
    //declaration of components and frame
    public static JFrame frame;
    public static Container container;
    public static JLabel back;
    public static Image backI;
    public static ImageIcon backi;
    public static Dimension d=Toolkit.getDefaultToolkit().getScreenSize(); //for resolution independency

   
    public Resolution_independent() throws Exception{
        frame=new JFrame();
        container=frame.getContentPane();
        container.setLayout(null);
        back=new JLabel();
        //Set bounds of all controls
        frame.setBounds(0, 0, d.width, d.height);
        back.setBounds(0,0,frame.getWidth(),frame.getHeight());
       
        //background image
        backI = ImageIO.read(new File("F:/Pics/SUCCESS.jpg"));   
        backI = backI.getScaledInstance(back.getWidth(), back.getHeight(),Image.SCALE_REPLICATE);
        backi = new ImageIcon(backI);
        back.setIcon(backi);//set icon as image
       
       
        //adding Jlabel to container
        container.add(back);
       
        frame.setUndecorated(true);
        frame.setVisible(true);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
       
    }

    public static void main(String[] args) throws Exception {
        Resolution_independent re=new Resolution_independent();

    }

}

And here is the image I have used:


Happy Designing!

Saturday, 12 September 2015

How to get started with the web designing

Hello everyone, today I got up with some facts and reality about the web designing basics. This is the first time I am providing you something about web designing first time since it is the most demanding technology if you want to work as a UI designer. Web designing is not more different than the other technology in the perspective of designing. The difference occurs in the usage and the scope. I will demonstrate the basic things here with some examples.

 

1. What is web designing?

According to my experience and usage, I will describe it in my words. Web consists of many things that may help to reach more people at a particular instance. In order to attract more people, User Interface of the web page is very critical task and no wonders they will get more stipend then a basic desktop designers. Web pages are just the pages or sub-pages that will help to describe your website. I have designed many of the sites using HTML and JSP, PHP, CSS but it were worked well because I have designed it very well and spend more time on designing only. So, if you are a designer than you are very crucial part of the web designing.

 

2. How to start designing it?

As I have told you about the web designing, now I will just suggest you some sites for get hands on it very well as I have also learnt from it. I will advice you to directly start with the website(any website I have e-shopping) rather just practicing each and every module of that technology. The reason behind it is that if you spend your precious time on the learning and practicing those modules you will realize somewhere that there is no end to it, so just start thinking of a website and start designing. I will here providing you with the designing aspects and you just refer those suggested websites and you are done.

 

Following are the websites that will help you to learn at least basics of web development: 

  • You can also refer this website

    There are many website which provide you web development part but I prefer above website. Also there are more technologies like php but the above given three are mostly preferred to develop a web page but still if you want to learn php and more, you can refer above site itself.

    If you have any issue regarding this please contact me directly through mail or comment on the blog. I am finishing now here this blog post by hoping that in the next post you will be well prepared with the basics of the web page development.

    Happy Designing

Sunday, 30 August 2015

Designing the Animations- Java 7(Part 1)


I am back again with the thing that will make you feel joyful and exciting. I was already gave you a basic knowledge about the designing in Photoshop. Today I will demonstrate you all about the animation in java with the help of obviously Adobe Photoshop.

Here are the things you will need while going through out the tutorial:
  1. Adobe Photoshop
  1. Java 7
  1. Eclipse Luna

Step 1.
First thing you need to do is that just create a ball in Adobe Photoshop. Don't worry,  I will help you out with this as usual.

Just select the shape tool but it doesn't appear as you move your mouse upon it. It's depends upon your previous selection in project. It may be named Line tool, Polygon tool, etc. You need to select Ellipse tool.  I already explained about Toolbox tools and selection. 

 
Initial Stage

Now draw it on the workspace like I have done. Get a reference of the image given above.

You will have a kind of scenario as shown above. It may differ as you are doing it in your own way. I am assuming that you have done with it and colored your ball. But still there's something you that don't make you feel it as a ball so here is the trick for giving it an illusion of 3d ball.

Step 2.
Remember guys everything you see in the real life is completely a part of illusion but that doesn't mean that everything you see in real world is falsified. It's just contains some illusions. So here is our illusion in virtual world, first of all make sure you have colored ball with something dark as I have done. 

Create ball


As I have selected blue color because it seems really shining color. Now the next thing you need to do is that select brush tool. But it will not allow you to color it directly so first Rasterize by right clicking on the Layer(Shape 1 if you didn't named it) and select Rasterize option. Now you have the rights to color it through any color.

Step 3.

Just now select Brush tool to make the ball shine. Change the foreground color to white and just click once on the area where you want the shine on ball like I have done. Note: Select entire ball by CTRL+ Left Click on the Shape 1 layer on layer Bar, it will select entire ball at once and then put the brush tool containing white and size may vary based on your scenario.
Final touch on ball
 Here is the sample ball I have created in png format:
In the Next tutorial I will describe the further steps.

Happy Designing.

Saturday, 25 July 2015

Remove Background from a picture

Hello Designers, I am posting after a very long break but it is a necessity to take a break to design and increase scope of designing for a designer. So, today I bring you a basic method of removing the background from a picture which is very complicated work actually but after a long time work you will get definitely what you want.


1. First decide picture(Normally with single color background for start up):

Here is the picture of Vivekananda I have taken for this purpose:

note: You can use this image for reference.

2. Now start work on Photoshop 7.0 or above:

 Next, you need to create new workspace by pressing CTRL+N or by using Menu bar>File>New.

Make sure you will have blank workspace, then copy and paste your picture above or go to Menu Bar>File>Open>Browse your picture

It will appear like this::

3. Select Lasso tool:

Need to right click on the tool menu to select Lasso tool if it is not already selected tool. Now next step will be selecting the area of interest only that means Vivekananda's picture only same like as I have done:

3. Copy the selected item on other workspace

Here you will require another blank workspace, just add it and paste this on that workspace just like I have done::

Here you can also just drag and drop on the other workspace like me.

next go to the tool menu and select Magic Wand Tool:

4. Now erase extra matter on picture:

Here, it is somehow haptic task to eliminate those extra matter, but don't worry you can do it anyhow with me.

Now delete this area using delete button on your keyboard and similarly select others with the help of magic wand tool but there may be some instance where you need to manually erase things by using Eraser Tool as shown below:

In such scenario you need to use eraser tool, and use this tool with caution because it may erase your crucial part of picture but thank Photoshop that we have ctrl+z facility. So try it because you may not succeed in the first time.

Note: reduce the size of eraser from the properties menu above the Tool Box. Your picture will look like as below picture:

In order to hide some cutting edges you can use blending options that I have applied to it.

Now you are ready with your image and just add a background to it that you have previously created by using my previous tutorials Design Background

5. Finalize:

Now this is the final step of this tutorial, you need to use now the blank workspace with size 1366*800 approximately and drag and drop the pic to the blank workspace. I have added a simple background with some quotes

You need to select the background layer then

If you want to enhance more then you can use Brush tool on the border of Vivekananda's picture. It will definitely enhance the quality.

Here, I leave my tutorial with you to place another tutorial to show you more but this time I will use a programming language.

Happy Designing.



Wednesday, 10 June 2015

Starting with the basic- Design a Background(Part 2)



Previously we have seen the various parts of Adobe Photoshop and their usages with diagrams. We have already seen how we can open a window in Photoshop and select what we want from the options. Now I will tell you actual background designing, you do not worry about it just some try and you have done it.



So, here is the window you will get after clicking OK button on that sub-window you have seen after selecting New from Menu Bar provided with the setting you see in that image I uploaded in previous blog.


New window appears



Then select Magic Wand tool for selecting the whole area on window and your cursor will change to that tool, now click on the window which is shown :
Select Magic Wand Tool
Now the whole area is highlighted with the dotted lines on the border that means it got selected. After that you need to choose tool that can fill that with something. And for that we will use Brush Tool:
Select Brush Tool
Now its time to look into our design window, just select a particular color. For my background I have chosen three colors i.e first ORANGE then White and then Green. You can choose yours, I have chosen these because I am designing Indian Flag as background. 
Color Picker
Now just ensure that you have selected the Brush Tool and in the Option Pane choose the stroke style, now just make a stroke on the design window as I have done below:


Strokes

 Finally you will get the image as above, now you can save it as any extension you want. I used to save it as either PNG or JPEG extensions, after clicking OK you need to select quality of image.
Save File as JPEG

JPEG Options

Here you just select the quality as I used in the image or choose any of your choice. I saved file as jpeg and it will appears amazingly as background is converted to white but if you save it in png format you will see that its background will be empty. Just try to save it. You can use your creativity and thinking to design fabulous backgrounds.

Here is the final jpeg image I have created.
flag.jpeg
Conclusion
So I have just demonstrated very basic designing in Photoshop using strokes to design your own background pic. There are too many tools yet, just try to use it otherwise I am always there to share my experience with all the stuff in my next blogs. In next tutorial I will demonstrate to enhance this image more precisely by using software other than Photoshop.

---Good Luck---



Tuesday, 9 June 2015

Starting with the basic- Design a Background(Part 1)


I will start with the basic of designing the background images for any foreground. I started with the Adobe Photoshop 7.0 at early stages of my designing. You should start with this version of Adobe Photoshop in order to learn the core parts even further versions are also requiring these basics as they are developed based on this.


Installation Steps:

  1. Download the Adobe Photoshop 7.0(recommended) or cs6 either from this link:



      OR 


  1. Install the software and enter the key you got. Open the Photoshop


  1. Just click OK when a dialog appears in front of you after reading everything. Now you are ready to do the magic stuff.


So after this small introduction I just starting the tutorial which can be detailed below:


Know the Parts:



First you should have knowledge of what you are using and here is the snapshot of the window you will get after installing and opened in windows:



Parts of Adobe Photoshop
Here is a small introduction to the parts of the window you see:

  1. Toolbox: This contains many tools that can help you to design and enhance your image.

Tool Box
  1. Navigation Bar: This the navigation window of your creations you are working in the same session.

  1. Color manager: This window helps you to apply and experiment various color combinations you want to add, as this is an alternative way of applying colors.
  2. History pallet: This provides the way of undoing the changes we have made in our image window. All the actions and events we have made on image stored here.
  3. Layer manager: This window helps to mange our layers that we have created in our image.

We can copy or duplicate any layer anytime and also remove it by just right clicking on it.



Open New Window:



To start any design you should create an empty window by clicking on Menu Bar: File>>New

A sub-window appears like below (You can instantly press ctrl+n):
Open New Window
Please select pixels from the width and height, by default its inches.

Conclusion:
It is the first part which contains introduction to the Photoshop and tried to make you feel comfortable with the parts of Photoshop. Don't miss the next blog in which I will actually starting the designing Background.

---Good Luck---

Monday, 8 June 2015

Do we know actual meaning of designing?



 I am not a rookie but also not an expert in this field, I am always trying to improve myself every second. I will share how I learnt all stuff and how I implemented it in the day to day life. The most important thing you should know and I realized that the designer should always think something even if it is nothing and that’s make them very uncommon and unique from others who don’t .

 Whenever you decide to design something then their will be many things you should obey, these are not actually the rules and regulations but the necessity to be a good designer. The graphics is most important in our life because it is a way to express yourself similar like DANCE. So if you want to be a designer you should be good enough to express yourself in any way.

What design meant?

 I am starting this blog for making everyone believe that they can also design. Designing is not the proprietary of  a particular person, but it is the art of expressing your thoughts in the form of visual perspectives. There was always a myth in everyone's mind that designing is only the subject of civil and mechanical engineers because they have to build machines, they need to know about the divider and all geometry stuff and that's why many of us believe that we have to learn all geometry stuff even if we are not belongs to that field.


Design mean this


 But I will tell you through my blog about various approaches that can help you to design with less complexity of geometry stuffs that we have learned in the 9th and 10th standard and that is the reason I believe that Any Body Can Design i.e. ABCD rapidly.

Conclusion
So, I will try my best to share all my knowledge with you in order to nurture your creativity and design skills. Be with me for further exciting tutorials with tools and programming to design.