AE 里在形态层上选ADD后的rectangle' 或者是ellipse...有什么作用啊...

yonghu 109 0

本文共计5956个文字,预计阅读时间需要19分42秒,欢迎阅读借鉴、一起学习、进步,内容来自小编精心整理收集,如有不正确和疑问,欢迎指正。

AE 里在形态层上选ADD后的rectangle' 或者是ellipse...有什么作用啊?

以形状中心点绘制一个rectangle(正方形)或者是ellipse(圆形)
可以通过开关进行掏空,并做形状叠加、扩散的动画
是绘制特殊图形的一种方法,也是做形状碰撞动画的一种方法

dc.Rectangle(clientRect.left,***.top-5,clientRect.right,clientRect.bottom+2);

CRect clientRect;
GetDlgItem(IDC_STATIC_HeightHist)->GetWindowRect(&clientRect);
ScreenToClient(&clientRect);

dc.Rectangle(clientRect.left,***.top-5,clientRect.right,clientRect.bottom+2);

//Rectangle函数的作用究竟是什么?与之前定义定义的clientRect直接存在什么样的关系?

在客户区域内绘制矩阵。
dc.Rectangle(clientRect.left,***.top-5,clientRect.right,clientRect.bottom+2);

下面分享相关内容的知识扩展:

winform showdialog()出现错误,提示:值不能为空。参数名: dc

我自定义了一个窗体,在主程序中使用showdialog()显示出来,但是却提示值不能为空。参数名: dc的错误,具体信息请见:
在 System.Windows.Forms.VisualStyles.VisualStyleRenderer.DrawBackground(IDeviceContext dc, Rectangle bounds)
在 System.Windows.Forms.Form.OnPaint(PaintEventArgs e)
在 System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
在 System.Windows.Forms.Control.WmPaint(Message& m)
在 System.Windows.Forms.Control.WndProc(Message& m)
在 System.Windows.Forms.ScrollableControl.WndProc(Message& m)
在 System.Windows.Forms.ContainerControl.WndProc(Message& m)
在 System.Windows.Forms.Form.WndProc(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
在 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
在 System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
在 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
在 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
在 System.Windows.Forms.Application.RunDialog(Form form)
在 System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
在 System.Windows.Forms.Form.ShowDialog()

我断点检查了一下,发现代码是运行到Form_Load事件结束的‘}’上发生错误的,不知道怎么解决,请帮忙,谢谢!
---------------------------------------
这是showdialog的代码。中间的两句可以不看,我自己写的
frmRender render = new frmRender(_layer);
render.CurrentSymbol = LayerOperate.GetCurrentSymbolFromLayer(_layer);
render.FeatureRenderer = _featureRenderer;
if (render.ShowDialog() != DialogResult.OK)
return;
这是load事件的代码:
private void frmRender_Load(object sender, EventArgs e)
{
AddRenderType();
if (_featureRenderer is ISimpleRenderer)
tvRenderType.SelectedNode = tvRenderType.Nodes[0];
else if (_featureRenderer is IUniqueValueRenderer)
tvRenderType.SelectedNode = tvRenderType.Nodes[1];
} --------运行到这报错
这里可能发生了重绘的错误,看这些代码看不出问题来,重绘的时候System.Windows.Forms.VisualStyles.VisualStyleRenderer.DrawBackground(IDeviceContext dc, Rectangle bounds)
dc你么有赋值,或者只是一个NULL,没有获得你上下文的句柄,不知道要重绘哪一部分

JAVA,写一个名为Rectangle的类表示矩形

写一个名为Rectangle的类表示矩形。其属性包括宽width、高height和颜色color,width和height都是double型的,而color则是String类型的。要求该类提供计算面积的方法getArea()方法,以及修改width和height的值及获得width和height当前值的方法。要求:
(1) 使用构造函数完成各属性的初始赋值
(2) P52使用getter和setter的形式完成属性的访问及修改
(3) P63 重载toString()方法,把矩形对象的宽,高,以及颜色显示出来。
(4) 自定义测试函数
这个我做完了 希望您能满意

public class Rectangle {
private double height;
private double width;
private String color;
public double getHeight() {
return height;
}
public void setHeight(double height) {
this.height = height;
}
public double getWidth() {
return width;
}
public void setWidth(double width) {
this.width = width;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
public Rectangle(double width,double height,String color){
this.setColor(color);
this.setHeight(height);
this.setWidth(width);
}
public void getArea(){
double area=0;
area=this.height*this.width;
System.out.println("矩形的面积为"+area);
}
public String toString(){
String recStr="矩形的高度:"+this.getHeight()+"宽度:"+this.getWidth()
+"颜色:"+this.getColor();
return recStr;
}
/**
* 测试函数
* @param args
*/
public static void main(String[] args) {
Rectangle rec=new Rectangle(3, 4, "红色");
rec.getArea();
System.out.println(rec.toString());
}
}

c#怎么使用PostMessage函数模拟按键输入啊

[DllImport("user32.dll")]
static extern bool PostMessage(int hwnd, int msg, uint wParam, uint lParam);
private void button10_Click(object sender, EventArgs e)
{
PostMessage(this.hwnd, 72, 0, 0);
}
找到一个记事本程序的句柄,然后发一个按键消息 72是按H键, 可是不管用....这怎么回事啊...
DllImport("user32.dll")]
static extern bool PostMessage(int hwnd, int msg, uint wParam, uint lParam);
参数说明:int hwnd, int msg, uint wParam, uint lParam
第一参数是记事本的窗口句柄,这点必须要确认
第二个参数是消息windows消息,用WM_CHAR试试,在C#中需要定义WM_CHAR或者直接填WM_CHAR的值0x0102
第三个参数填H的键码
第四个参数是特征码

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.Drawing;
namespace TankLibrary
{
public class Win32API
{
[DllImport("user32.dll", EntryPoint = "FindWindow", CharSet = CharSet.Auto)]
public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
[DllImport("user32.dll")]
public static extern IntPtr GetDC(IntPtr hwnd);

[DllImport("Gdi32.dll")]
public static extern uint GetPixel(IntPtr hdc, int nXPos, int nYPos);

[DllImport("user32.dll")]
public static extern int mouse_event(int dwFlags, int dx, int dy, int cButtons, int dwExtraInfo);
const int MOUSEEVENTF_MOVE = 0x0001; //移动鼠标
public const int MOUSEEVENTF_LEFTDOWN = 0x0002; //模拟鼠标左键按下
public const int MOUSEEVENTF_LEFTUP = 0x0004; //模拟鼠标左键抬起
const int MOUSEEVENTF_RIGHTDOWN = 0x0008; //模拟鼠标右键按下
const int MOUSEEVENTF_RIGHTUP = 0x0010; //模拟鼠标右键抬起
const int MOUSEEVENTF_MIDDLEDOWN = 0x0020; //模拟鼠标中键按下
const int MOUSEEVENTF_MIDDLEUP = 0x0040; //模拟鼠标中键抬起
const int MOUSEEVENTF_ABSOLUTE = 0x8000; //标示是否采用绝对坐标

public const int HWND_TOPMOST = -1;
public const int SWP_SHOWWINDOW = 40;

[StructLayout(LayoutKind.Sequential)]
public struct RECT
{
public int left;
public int top;
public int right;
public int bottom;
}

[DllImport("user32.dll", EntryPoint = "SetWindowPos")]
public static extern int SetWindowPos(int hWnd, int hWndInsertAfter, int x, int y, int cx, int cy, int wFlags);
[DllImport("user32.dll")]
public static extern IntPtr GetWindowRect(IntPtr hWnd, ref RECT rect);
[DllImport("user32.dll")]
public static extern IntPtr GetWindowRect(IntPtr hWnd, ref Rectangle rect);

[DllImport("user32.dll")]
public static extern Int32 ReleaseDC(IntPtr hwnd, IntPtr hdc);
[DllImport("user32", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
public static extern bool SetForegroundWindow(IntPtr hwnd);
[DllImport("user32.dll", EntryPoint = "PostMessage")]
public static extern IntPtr PostMessage1(IntPtr hWnd, uint Msg, int wParam, int lParam);
[DllImport("user32.dll")]
public static extern bool SetCursorPos(int x, int y);

public static void ClickOn(IntPtr hwnd, int x, int y)
{
uint WM_LBUTTONDOWN = 0x0201;
uint WM_LBUTTONUP = 0x0202;
PostMessage1(hwnd, WM_LBUTTONDOWN, x, y);
PostMessage1(hwnd, WM_LBUTTONUP, x, y);
}
}

}

抱歉,评论功能暂时关闭!