Tuesday, October 19, 2010

ShotGraph ordinary principles of drawing


ShotGraph ordinary principles of drawing

ShotGraph in the following environments:

Visual Basic

VBScript

Visual Basic for applications (VBA), Word, Excel, etc.

Active Server Pages (ASP) engine with Internet Information Server

Perl for Windows

others

ShotGraph size = 3> COOL code:

href = "http://www.aspcn.com/aspcn.asp?title=shotgrap_upload"> upload file

href = "http://www.aspcn.com/aspcn.asp?title=shotgrah_counter"> counter

href = "http://www.aspcn.com/aspcn.asp?title=shotgrah_gif"> art GIF animation graphics

href = "http://www.aspcn.com/aspcn.asp?title=shotgrah_draw"> painting graphics

Let's first take a simple:

Step by step


First, the establishment of an object "shotgraph.image".

Use href = "http://www.aspcn.com/aspcn.asp?title=shotgraph_createimage"> CreateImage
Methods.

Use href = "http://www.aspcn.com/aspcn.asp?title=shotgraph_setcolor"
?> SetColor method to define one or multiple colors of paint to use.

Clear the area you plan all the content, if necessary, using the href = "http://www.aspcn.com/aspcn.asp?title=shotgraph_setcolor"> FillRect
Generally felt that way.

Effective way to use drawing.

Use href = "http://www.aspcn.com/aspcn.asp?title=shotgraph_gifimage"> GifImage
Function. Your picture is complete!

The following is a simple example how to use shotgraph drawing.

The size of the image is 201x201.

VBScript code:

set obj = CreateObject ("shotgraph.image")

size = 201
''Calling the CreateImage method
obj.CreateImage size, size, 4

''Set 4 colors for drawing
obj.SetColor 0,255,255,255
obj.SetColor 1,0,0,0
obj.SetColor 2,255,108,0
obj.SetColor 3,0,0,204

''Crearing the painting area with color 0
obj.SetBgColor 0
obj.FillRect 0,0, size-1, size-1

''Color 0 will be used for drawing
obj.SetDrawColor 1
''Drawing the line
obj.Line size-1, 0,0, size-1
''Color 2 will be used for filling
obj.SetBgColor 2
''Draw the big circle
obj.Ellipse 5,5, size-6, size-6
''Color 2 will be used for filling
obj.SetBgColor 3
''Draw the small circle
obj.Ellipse 5, (size-5) / 4, size / 2, (size-5) * 3 / 4

''Create the image file named test.gif
obj.GifImage 0,1, "test.gif"




[Next]



Here is the ASP and PERL code:
asp

$ Obj = CreateObject ("shotgraph.image")

$ Size = 201
$ Obj-> CreateImage ($ size, $ size, 4)
$ Obj-> SetColor (0,255,255,255)
$ Obj-> SetColor (1,0,0,0)
$ Obj-> SetColor (2,255,108,0)
$ Obj-> SetColor (3,0,0,204)
$ Obj-> SetBgColor (0)
$ Obj-> FillRect (0,0, $ size-1, $ size-1)

$ Obj-> SetDrawColor (1)
$ Obj-> Line ($ size-1, 0,0, $ size-1)
$ Obj-> SetBgColor (2)
$ Obj-> Ellipse (5,5, $ size-6, $ size-6)
$ Obj-> SetBgColor (3)
$ Obj-> Ellipse (5, ($ size-5) / 4, $ size / 2, ($ size-5) * 3 / 4)

$ Obj-> GifImage (0,1, "test.gif")







Recommended links:



Rising DRUG war Kaspersky million reward



Strategy And War Games Infomation



ENVIRONMENTAL regeneration of computer donations to needy students



Automation is everywhere



give a life to your MOBILE with free mobile themes



ASF to MPG



Health wine listed first off over five



AVI to 3GP



Alibaba Ma: Even if I have to FINALLY kneeling down



WMV to MPEG



Premier Download Managers



Blizzard and Ninetowns, who moved Founder's fonts?



GUIDE Computer Education



Ten controversial Figure in 2007



Lists Dictionaries Education



Wednesday, October 6, 2010

Describes the properties of the problem MIDP


This article aims to explain the properties in question MIDP, mainly related to the jad and MANIFEST.MF files of some of the concepts. In fact many people did not know the details in this regard. So you should carefully read this article.

MIDP applications are usually based. Jar files and. Jad files released. jar file is what we call the jar package, jad file's full name is the java application descriptor. In the jad file contains the Application Management Software to manage MIDlets in the life cycle of information, of course, include many important properties. They are in pairs for example: MIDlet-Name: myjava. You can call getAppProperty ("MIDlet-Name") to get the String type of myjava, which is very handy if you want your MIDlet to the network then you can define a name for the SERVER_URL, define the value of it http://yourip:port/myservlet, so if you want to connect to other addresses, then only need to modify the jad file, and do not need to recompile. Therefore, we must be aware that some of the jad file MIDlet initialization which needs to place value is more desirable.

In the jar package which includes a directory META-INFO files inside a MANIFEST.MF. It is used to describe the JAR file also contains some other information, you may find, in the MANIFEST.MF and the JAD file, some of the values are the same. Then there is a rule which, AMS how to determine which value to read it? The answer is this.

If the MIDlets in the jar package is signed, then the AMS to go look at its digital signature, if it is effective then it will begin to read the contents of MANIFEST.MF, and then read the jad file the same content, so if the match would It will install the jar package, if you do not match, then it will refuse to install. If he found that the digital signature is invalid, then it will refuse to install directly.
If MDIlets the jar package is unsigned, then put it considers non-trust AMS, and he went to read the jad file attributes, if found not to read the MANIFEST, then it's content, which means that if both jad and MANIFEST AMS only to read the attributes in jad.

Following this logic appears to be more clear:
given: String key / / attribute name
return: String value
throws: NullPointerException if key is null

if trusted
String v0 = lookup key in manifest
String v1 = lookup key in descriptor

if (v0! = null & & v1! = null)
/ / Found in both; must be the same value
assert (v0.compareTo (v1) == 0);

value = (v1! = null)? v1: v0;
else / / untrusted
value = lookup key in descriptor

if value == null
value = lookup key in manifest

return value

The following outlines some important MIDP2.0 defined the parameters defined in MIDP2.0 18 value. Which in the MANIFEST.MF and the jad in the six must be defined, they are:
MIDlet-Name
MIDlet-Version
MIDlet-Vendor
MicroEdition-Profile
MicroEdition-Configuration
MIDlet-n
As the inside of a MIDlet suite can have multiple MIDlet, so you have to explain them such as MIDlet-1, MIDlet-2 ..... MIDlet-n, it is very important, in the deployment jar and jad files to the phone when must ensure that the correct MIDlet-Name, its value is the name of your jar package! Otherwise does not install successfully. There are two values is the jad file, they allowed some MIDlet-Jar-URL,
MIDlet-Jar-Size One should note that the MIDlet-Jar-URL, if you wanted to download via OTA, then you must not let him point to the absolute address of your jar package, such as http://myip:port/app/myapp. jar.

On more than one MIDlet suite MIDlet inside the case I wrote a simple code to test it, so if you have questions about what you can run the following procedure:
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Form;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;

public class MIDlet1 extends MIDlet
(

private Display display;


protected void startApp () throws MIDletStateChangeException
(

display = Display.getDisplay (this);
display.setCurrent (new Form ("1"));
)

protected void pauseApp ()
(
)

protected void destroyApp (boolean arg0) throws MIDletStateChangeException
(
)

)
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Form;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;


public class MIDlet2 extends MIDlet
(

private Display display;


protected void startApp () throws MIDletStateChangeException
(
display = Display.getDisplay (this);
display.setCurrent (new Form ("2"));
)


protected void pauseApp ()
(


)

protected void destroyApp (boolean arg0) throws MIDletStateChangeException
(
)

)
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Form;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;

public class MIDlet3 extends MIDlet
(

private Display display;


protected void startApp () throws MIDletStateChangeException
(
display = Display.getDisplay (this);
display.setCurrent (new Form ("3"));
)


protected void pauseApp ()
(
)

protected void destroyApp (boolean arg0) throws MIDletStateChangeException
(
)

)
JAD file as follows:
MIDlet-3: MIDlet3,, MIDlet3
MIDlet-2: MIDlet1,, MIDlet1
MIDlet-1: MIDlet2,, MIDlet2
MIDlet-Jar-URL: MIDlets.jar
MicroEdition-Configuration: CLDC-1.0
MIDlet-Version: 1.0.0
MIDlet-Name: MIDlets
MIDlet-Vendor: Midlet Suite Vendor
MicroEdition-Profile MIDP-1.0

The above three. Java files are packaged into MIDlets.jar file, then double-click. Jad file. Program can be run up, I wtk2.1 run without any problems!






Recommended links:



Thread contact mechanism



RHEL5.2 DNS and DHCP interaction next update



My favorite Food And Drink



FLV to Zune



Cottage In China



Thunder ruthless anti-piracy or abandoned by advertisers



PPT to teach you to easily modify the colors in the clip art



Taobao is free of charge commitment charges due to question



Column to add or modify the rules



Reflections on the Supervision and standardization



Report Audio VIDEO Tools



Comment Wizards And Components



How to PROMOTE sales will not die



how to fix a Broken ipod



VOB to SWF



3GP to MPEG