First, the shape of the painting can be specified when the shapedrawable is constructed,
Second, you can use Shape.getpaint (). Setshader (); Specify Shader,shader can accept a picture and matrix
So the problem is solved smoothly:
Specifically implemented as follows:[Java]
Copy Code code as follows:
float scale = 1.2f;
int cx = 224;
int cy = 357;
int r = 200;
Specifies that the shape creates a shapedrawable
Shapedrawable shape=n
(hR = s_ OK );
Long nwidth, nheight; // width and height, mm_himetric mode, in 0.01mmPpicture-> get_width ( nwidth); // widthPpicture-> get_height ( nheight); // high
Crect rect;Getclientrect ( rect );
Csize SZ (nwidth, nheight );PDC-> himetrictodp ( sz); // converts the mm_himetric mode to the mm_text pixel unit.Long X, Y, CX, Cy;
// Original size/*Cx = Sz. CX;
Chapter 4 first programExperiment 3 programming, compilation, connection, and tracking1. Save the following program as a t1.asm file and generate the executable file t1.exe.Assume Cs: codesgCodesg segmentMoV ax, 2000 hMoV SS, axMoV sp, 0Add SP, 10Pop axPop BXPUSH AXPush BXPop axPop BX
MoV ax, 4c00hInt 21 h
Codesg ends
End
2. Use debugto track the execution process of t1.exe and write the internal
Content on the content and stack topDebug t1.exe-RAx = 0000 BX = 0000
Note that there are programs and test programs. For example, exp1303.asm refers to Chapter 13's third question. exp1303. ASM refers to the test of exp1303 program...
; Exp1301.asm
Install the 7ch Interrupt RoutineFunction: calculates the square of a word number.;;Assume Cs: Code
Code segmentStart:; Copy the code to a non-system management areaMoV ax, CSMoV ds, axMoV Si, offset sqr; copy from sqr of CS segment to 0: 200
MoV ax, 0MoV es, axMoV Di, 200 h
MoV
functions. This pointer is stored in the Cx register and the parameters are pressed from right to left. _ Fastcall: it transmits parameters through registers (in fact, it uses ECx and EDX to transmit the first two DWORD or smaller parameters, the rest of the parameters are still transferred from the right to the left pressure stack, and the called function pops up the parameter stack before returning ).
For more detailed call conventions, refer to ca
Recently, I saw the Delphi Program for a lifetime of component graphics on the Internet. The generated graphics are very beautiful, so I changed it to C ++ and improved the generation efficiency.
The Code is as follows (the original code uses the plural operation and is removed for efficiency, but is still kept in the comment)
// This function is used to obtain the color. S is between [0, 1] and the color is continuous.
Colorref getcolor (double S)
{
Int R, G, B;
If (s {
G = int (255 * s/0.25 );
For C ++, function overloading exists, for example:
void CCNode::setScale(float scale)void CCNode::setScale(float scaleX,float scaleY)
The two functions have the same name, but different parameter tables. Finally, the function signature after compilation is different.
However, this mechanism does not exist in JavaScript. How can this problem be solved? There are two situations:
First, JS needs to call the overloaded C ++ function interface
Let's take the above functions as an example to see h
ns/op 0 b/op 0 allocs/op ' ' You can also run [test cases] (HTTPS://PLAY.G OLANG.ORG/P/INJCAOXZPVG) (copy the code into your local ' main.go ' file and execute ' Go run main.go '-you won't be able to run this code in playground due to the running time limit). Still find the evidence insufficient? Let's take this [small example] (https://play.golang.org/p/F4xsmeGwy5d) as an example and export the assembly code. Save it to ' Main2.go ' and execute ' Go tool compile-s main2.go > Main.s '. Review t
Online circulating is a 2.x version, has now been updated to 3.x, after arduous, finally debugging success.1. First define the class to be boundAnimationkoo.h#ifndef __animationkoo_h__#define __animationkoo_h__namespace Ls{class AnimationKoo{public:virtual void Functest (); Static Animationkoo * Create ();};} #endif//__animationkoo_h__animationkoo.cpp#include "Cocos2d.h" #include "cocos2d_specifics.hpp" #include " AnimationKoo.h "void Ls::animationkoo::functest () {Cclog (" binding test ... ");
.
Instructions
The assembler uses a variety of directives to bind text and data to symbol names. For example, here is a simple but complete function definition. The TEXT directive declares the symbol runtime Profileloop, which is immediately in the body similar to the function. The end of the TEXT block must be some form of jump, usually a RET(pseudo) instruction. (if not, the linker appends an instruction that jumps to the block itself, theTEXT block does not have a fallthrough) after the symbo
{thensym, dosym} + fsys, lev, Tx ); /* analyze and compute the logical expression, and add the then and do statements in the error recovery set */If (sym = thensym)/* after the expression */getsym (); /* the token obtained after then should be a statement */elseerror (16);/* If then does not exist after if, a 16th error is thrown */cx1 = Cx; /* write down the pointer position of the current Code allocation */Gen (JPC, 0, 0);/* generate the conditiona
: encodeS file sizeL add the 100 h f sub-command to the file to fill in the memory length.C is only used to calculate the first encoding time.K judge C1 C2 C3W each line generates several 4-byte encoding characters. The default value is 18.If Q is equal to W, a line of encoded strings is output.N is used to filter out duplicate bytes.: Encode> NUL (chcp 437 graftabl 936)CLSFor % I in (% infile %) do set S = % ~ ZiIf % S % equ 0 exit/BIf % S % gtr 65535 set error = encoding failed. The maximum f
R Where R · X · Y is a word group, which requires that X and Y be placed in the D_SEG segment, and R be placed in the E_SEG segment.D_SEG segment
X dw 200,241,308,102,124 7
Y dw 20, 25, 2530,888,356
D_SEG ends
E_SEG segment
R dw 5 dup (?)
E_SEG ends
Groups roup group D_SEG, E_SEG
Code segment
Assume cs: code, ds: Role roup
Main proc far
Mov ax, role roup
Mov ds, ax
Call compute
Mov ax, 4c00h
Int 21 h
Main endp
Compute proc near
Mov cx, 5
Mov si, 0
Nex
32-bit CPUs contain the following registers:
Four data registers (eax, EBX, ECx, and EDX)2 address changes and pointer registers (ESI and EDI) 2 pointer registers (ESP and EBP)Six segment registers (ES, Cs, SS, DS, FS, and GS)1 Instruction Pointer register (EIP) 1 flag register (eflags)
1. Data RegisterData registers are mainly used to save information such as the operands and operation results, thus saving the time required to read the operands by occupying the bus and accessing the memory.The
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.