小编slu*_*ter的帖子

CoreAnimation,AVFoundation和进行视频导出的能力

我正在寻找将我的图片序列导出为快速视频的正确方法.

我知道AV基金会能够合并或重新组合视频,还可以添加构建单个视频资产的音轨.

现在......我的目标有点不同.我想从头开始创建一个视频.我有一套UIImage,我需要在一个视频中渲染所有这些.我阅读了有关AV Foundation的所有Apple文档,我找到了AVVideoCompositionCoreAnimationTool类,它能够获取CoreAnimation并将其重新编码为视频.我还检查了Apple提供的AVEditDemo项目,但似乎有些东西在我的项目中没有用.

我的步骤:

1)我创建了CoreAnimation Layer

CALayer *animationLayer = [CALayer layer];
[animationLayer setFrame:CGRectMake(0, 0, 1024, 768)];

CALayer *backgroundLayer = [CALayer layer];
[backgroundLayer setFrame:animationLayer.frame];
[backgroundLayer setBackgroundColor:[UIColor blackColor].CGColor];

CALayer *anImageLayer = [CALayer layer];
[anImageLayer setFrame:animationLayer.frame];

CAKeyframeAnimation *changeImageAnimation = [CAKeyframeAnimation animationWithKeyPath:@"contents"];
[changeImageAnimation setDelegate:self];
changeImageAnimation.duration = [[albumSettings transitionTime] floatValue] * [uiImagesArray count];
changeImageAnimation.repeatCount = 1;
changeImageAnimation.values = [NSArray arrayWithArray:uiImagesArray];
changeImageAnimation.removedOnCompletion = YES;
[anImageLayer addAnimation:changeImageAnimation forKey:nil];

[animationLayer addSublayer:anImageLayer];
Run Code Online (Sandbox Code Playgroud)

2)比我实例化AVComposition

AVMutableComposition *composition = [AVMutableComposition composition];
composition.naturalSize = CGSizeMake(1024, 768);

CALayer *wrapLayer = [CALayer layer];
wrapLayer.frame …
Run Code Online (Sandbox Code Playgroud)

iphone objective-c avfoundation ios4

10
推荐指数
2
解决办法
8077
查看次数

注册应用程序失败,因为文件位于网络共享上.在注册包之前将文件复制到本地计算机

我使用这些示例来构建Windows 8应用程序:

http://code.msdn.microsoft.com/windowsapps/Getting-started-with-C-and-41e15af5

(注意:该链接是陈旧的,这可能是正确的:C#和Visual Basic入门:Hello World样本 )

当我尝试运行Windows 8设备模拟器时,出现此错误:

错误1错误:DEP0700:应用程序注册失败.拒绝从文件注册的请求:// psf/Home/Desktop /获得%20started%20with%20C#%20和%20Visual%20Basic%20Hello%20World%20and%20Blog%20reader%20samples%20(1)/ C#/ HelloWorld_Part1/bin/Debug/AppX/AppxManifest.xml,因为文件位于网络共享上.在注册包之前将文件复制到本地计算机.(0x80073cf9)HelloWorld_Part1

我在Mac上使用Paralells.什么文件夹不是网络共享?

c# windows

10
推荐指数
2
解决办法
3857
查看次数

如何在Powershell中使用Invoke-WebRequest重新创建一个有效的CURL命令

此curl命令按预期工作:

curl -H "X-Api-Key:j65k423lj4k2l3fds" `
     -X PUT `
     -d "alerts_enabled=true" `
        https://some/working/file.xml
Run Code Online (Sandbox Code Playgroud)

我怎样才能在PS中重新创建这个Invoke-WebRequest?我试过了

Invoke-WebRequest -Headers @{"X-Api-Key" = "j65k423lj4k2l3fds"} `
                  -Method PUT `
                  -Body "alerts_enabled=true" `
                  -Uri https://some/working/file.xml
Run Code Online (Sandbox Code Playgroud)

我也尝试过制作所有参数的对象(例如$headers = @{"X-Api-Key" = "Key:j65k423lj4k2l3fds"}和传递-Headers $headers).

谢谢

powershell curl

10
推荐指数
3
解决办法
5万
查看次数

VS2010在打开项目时抛出异常

当我尝试打开一个项目时,我得到一个例外,说Web应用程序配置为使用IIS.

错误:Web应用程序项目EntityServices配置为使用IIS.若要访问本地IIS网站,必须安装以下IIS组件:

  IIS 6 Metabase and IIS 6 Configuration Compatibility
Run Code Online (Sandbox Code Playgroud)

此外,您必须在管理员帐户的上下文中运行Visual Studio.

注意 - 我已经安装了IIS 7.我的盒子是x64位Windows 7盒子.

iis visual-studio-2010

9
推荐指数
1
解决办法
7057
查看次数

插入网络电缆/连接Wifi时通知

我正在C#中实现一个发现协议(DNS-SD).我有一个小问题:当我的程序运行时,我需要检测何时建立新连接(网络电缆插入或wifi连接),以便在这些网络上宣布自己.

但是如何检测呢?我已经看到一些代码来获取网卡的当前状态,但没有事件,我想避免对网卡状态进行一些轮询.

.net c# networking network-programming network-connection

9
推荐指数
1
解决办法
1956
查看次数

检查登录用户是否喜欢我的Facebook页面

好.所以我不知道如何做到这一点,但你将不得不像一个3岁的孩子一样对我说话.我知道PHP,HTML,CSS和一小撮javascript.我希望能够创建一个获取用户facebook的页面并检查他们是否喜欢我的Facebook页面(https://www.facebook.com/MrDarrenGriffin).如果有,重定向将指向页面.但是,如果没有,它会告诉他们要去下载页面,他们必须喜欢这个页面.喜欢的方法可以是代码中嵌入的like按钮.在他们喜欢该页面后,它将再次通过检查,如果他们已经成功地喜欢我的页面,它会将它们重定向到下载部分(或指定的页面).

提前致谢

facebook facebook-like

9
推荐指数
2
解决办法
3万
查看次数

ECMAScript中访问器属性和数据属性之间的区别?

ECMAScript版本5规范引入了一种称为访问器属性的新类型属性.与称为数据属性的现有和已知类型的属性相比,这两个事物如何仅在规范方面相互关联?

我已经阅读了ECMAScript v5的规范,我不清楚确切的区别.有人可以用代码示例解释这两个吗?我搜索过互联网,但所有的例子看起来都很模糊.

javascript accessor ecmascript-5

9
推荐指数
1
解决办法
2392
查看次数

C#接口的隐式和显式实现之间的区别

显式实现接口实现接口有什么区别.

当您从界面派生类时,intellisense建议您同时执行这两个操作.

但是,有什么区别?

c# interface

8
推荐指数
3
解决办法
1227
查看次数

如何设置编辑文本框的布局边距?

在表格布局中我有一个tablerow,在该tablerow中我有6个编辑文本框,我想为这6个编辑文本框设置布局边距

TableLayout t1=(TableLayout)findViewById(R.id.table_layout01);

  TableRow tr1=new TableRow(inventory.this);
  tr1.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));


  tr1.setBackgroundColor(Color.BLACK);
  EditText ed6=new EditText(inventory.this);
  //ed6.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));
  /*ViewGroup.MarginLayoutParams editmargin=new ViewGroup.MarginLayoutParams(ViewGroup.MarginLayoutParams.FILL_PARENT,ViewGroup.MarginLayoutParams.WRAP_CONTENT);
  editmargin.setMargins(leftMargin, rightMargin, topMargin, bottomMargin);*/


  ed6.setTextColor(Color.BLACK);
  ed6.setBackgroundColor(Color.WHITE);


  ed6.setText("1");
        tr1.addView(ed6);



  EditText ed7=new EditText(inventory.this);
  //ed7.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));
  ed7.setTextColor(Color.BLACK);
  ed7.setBackgroundColor(Color.WHITE);
  ed7.setText("2");

  tr1.addView(ed7);

  EditText ed8=new EditText(inventory.this);
  //ed8.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));
  ed8.setTextColor(Color.BLACK);
  ed8.setBackgroundColor(Color.WHITE);
  ed8.setText("3");

  tr1.addView(ed8);

  EditText ed9=new EditText(inventory.this);
  //ed9.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));
  ed9.setTextColor(Color.BLACK);
  ed9.setBackgroundColor(Color.WHITE);
  ed9.setText("4");

  tr1.addView(ed9);

  EditText ed10=new EditText(inventory.this);
  //ed10.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));
  ed10.setTextColor(Color.BLACK);
  ed10.setText("5");
  ed10.setBackgroundColor(Color.WHITE);

  tr1.addView(ed10);

  EditText ed11=new EditText(inventory.this);
  //ed11.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));
  ed11.setTextColor(Color.BLACK);
  ed11.setText("6");
  ed11.setBackgroundColor(Color.WHITE);

  tr1.addView(ed11);

  t1.addView(tr1);
Run Code Online (Sandbox Code Playgroud)

java android ellipse

8
推荐指数
2
解决办法
2万
查看次数

固定大小的缓冲区不能直接从"this"对象使用

我用一种结构来表示纯数据.其中一个字段是固定大小的缓冲区,如下所示.

[StructLayout(LayoutKind.Sequential, Pack=2)]
unsafe struct ImageDosHeader
{
    ...
    private fixed ushort _e_res[4];
    ...

    [Description("Reserved")]
    [DisplayName("e_res[0]")]
    public ushort e_res_0 { get { ... } set { ... } }

    ...
}
Run Code Online (Sandbox Code Playgroud)

在get/set函数中,我尝试执行以下操作,但是我得到"编译器错误CS1666:您不能使用包含在未固定表达式中的固定大小缓冲区.请尝试使用fixed语句."

return this._e_res[0];
Run Code Online (Sandbox Code Playgroud)

但是,以下工作:

fixed (ImageDosHeader* p = &this)
    return p->_e_res[0];

ImageDosHeader local = this;
return local._e_res[0];
Run Code Online (Sandbox Code Playgroud)

我可以轻松地使用变通方法,但是,我想知道为什么直接从这里访问固定大小的缓冲区是非法的.或者这是我应该报告的错误?

我使用的是.NET 2.0.

c# fixed this

8
推荐指数
2
解决办法
4220
查看次数