小编Mic*_*kis的帖子

Flash 形状中的“CurveTo”和“LineTo”

我正在尝试使用 Direct2D 显示一些旧的 SWF 文件。

\n

我找到了swfmill ,它是一个显示“W”的简单 SWF(在此处找到)

\n

在此输入图像描述

\n

生成 XML 代码,其中一部分如下:

\n
          <ShapeSetup x="-214" y="470" fillStyle1="1"/>\n          <LineTo x="-20" y="0"/>\n          <CurveTo x1="-35" y1="-74" x2="-45" y2="-109"/>\n          <CurveTo x1="-46" y1="-109" x2="-109" y2="-244"/>\n          <CurveTo x1="-110" y1="-244" x2="-32" y2="-50"/>\n          <CurveTo x1="-33" y1="-50" x2="-27" y2="-18"/>\n          <CurveTo x1="-27" y1="-19" x2="-21" y2="-3"/>\n          <CurveTo x1="-21" y1="-1" x2="0" y2="-9"/>\n          <CurveTo x1="0" y1="-10" x2="53" y2="0"/>\n          <LineTo x="304" y="0"/>\n          <CurveTo x1="43" y1="0" x2="0" y2="10"/>\n          <CurveTo x1="0" y1="10" x2="-24" y2="0"/>\n          <CurveTo x1="-100" y1="6" x2="0" y2="70"/>\n          <CurveTo x1="0" y1="16" …
Run Code Online (Sandbox Code Playgroud)

c++ flash direct2d

2
推荐指数
1
解决办法
168
查看次数

Why can I not increment the value of an int variable by using "++" when working with pointers?

I am trying to increment the value of an element inside an array, using a pointer storing that element's address.

When I write it as " p++; " it does not work, whereas if I write it as *p=*p+1 it works.

*p=*p+1; // this increments the value
*p++; //while this does not
Run Code Online (Sandbox Code Playgroud)

I am expecting both ways to work

c++ pointers increment

0
推荐指数
1
解决办法
63
查看次数

c中的%(模)运算符如何工作?

我正在尝试以下代码

printf("%d", 010 % 10);
Run Code Online (Sandbox Code Playgroud)

我期望它的输出是0,但它是8。

为什么?

c modulus

0
推荐指数
1
解决办法
57
查看次数

如何使用多核而不是多线程进行编程?

我正在研究一个项目(硬件:RaspberryPI 3B +),该项目具有大量的计算和并行处理。目前,我注意到代码性能有些滞后。因此,我一直在寻找有效的方法来改善代码及其性能。

目前,我正在使用C语言(因为我可以轻松地访问和操作较低级别的驱动程序)并开发自己的一组函数,库和驱动程序,其运行速度比任何其他预定义或现成的库或插件都要快。

现在,我想使用单独的内核来执行相应的任务,而不是基于软件的多线程读取(Pthread)。那么,关于如何使用RaspberryPI的不同核心的任何建议或指南?

此外,如何检查CPU使用率以选择最佳内核来执行特定任务?

致谢,阿提夫·谢赫(Aatif Shaikh)

c++ multithreading raspberry-pi

0
推荐指数
1
解决办法
108
查看次数

std::future&lt;&gt;::get 清空结果

我有一个线程函数可以返回外部 IP,并认为我可以将它用于std::future

std::future<std::string> GetIP4;
GetIP4 = std::async([]() -> std::string
    {
        return GetWanIP();
    });
Run Code Online (Sandbox Code Playgroud)

稍后在我调用的代码中GetIP4.get(),我得到一个std::string. 但是这会清空对象,所以下次我尝试get从另一个线程调用时它会崩溃。

这是预期的行为std::future<>::get()吗?是“我只有一​​次”的场景吗?我在文档中没有找到任何内容

c++ visual-studio visual-studio-2019

0
推荐指数
1
解决办法
77
查看次数