小编i m*_*dis的帖子

画架没有显示位图

这是我的画架js功能,它绘制一个红色圆圈和一个图像,但是圆圈正在显示,但图像不是.

function Start() {
          var stage = new createjs.Stage("DogeCanvas");
          var dog = new createjs.Bitmap("doge.jpg");
          var circle = new createjs.Shape();
          circle.graphics.beginFill("red").drawCircle(0, 0, 50);
          circle.x = 100;
          circle.y = 100;
          dog.x=100;
          dog.y=100;
          stage.addChild(circle, dog);
          stage.update();
    }
Run Code Online (Sandbox Code Playgroud)

这是html文件

<!DOCTYPE html>
<html>
    <head>
        <title>test</title>
        <script src="http://code.createjs.com/easeljs-0.7.0.min.js"></script>
        <script src="Doge.js"></script>

    </head>

    <body bgcolor="#C7C7C7" onload="Start();">
          <canvas id="DogeCanvas" width="480" height="320"></canvas>
    </body>
</html>
Run Code Online (Sandbox Code Playgroud)

为什么?请帮忙,好像在其他人的代码中这有用,但为什么这对我不起作用?

javascript html5 easeljs

10
推荐指数
1
解决办法
6700
查看次数

在easeljs中添加一个简单的图像

这是我的 html 代码:

<!DOCTYPE html>
<html>
<head>
    <title>test</title>
    <script src="http://code.createjs.com/easeljs-0.7.0.min.js"></script>
    <script src="Doge.js"></script>  
</head>

<body bgcolor="#C7C7C7" onload="Start();">
      <canvas id="DogeCanvas" width="480" height="320"></canvas>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

这是我的 Doge.js 代码:

function Start() {
      var stage = new createjs.Stage("DogeCanvas");
      var doge = new Image();
      doge.src = "images/doge.jpg"
      var bitmap = new createjs.Bitmap(doge);
      stage.addChild(bitmap);
      stage.update();
}
Run Code Online (Sandbox Code Playgroud)

为什么它在屏幕上不显示任何内容?怎么了?

html javascript easeljs

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

MySQL 和 C# 实体框架“ProviderIncompatibleException”

我正在按照此处列出的实体框架的 MySql 教程进行操作:https : //dev.mysql.com/doc/connector-net/en/connector-net-entityframework60.html

我已经通过 NuGet 安装在我的项目中:
- Entity Framework v6.2.0
- MySql.Data.Entity v6.10.7

以及它们对应的依赖关系。

我已经安装了 MySql CONNECTOR/NET v8.0.11。

我将提供者和 connectionString 添加到 App.config:

  <entityFramework codeConfigurationType="MySql.Data.Entity.MySqlEFConfiguration, MySql.Data.Entity.EF6">
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
    <providers>
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
      <provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.10.7.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
    </providers>
  </entityFramework>

  <connectionStrings>
    <add name="mysql" connectionString="Server=localhost,3306;Database=eneagramas;Uid=root;Pwd=1234;" providerName="MySql.Data.MySqlClient" />
  </connectionStrings>
Run Code Online (Sandbox Code Playgroud)

基本上我遵循了官方文档中的所有说明,这是我的上下文类:

class MyContext : DbContext
{
    public MyContext() : base("mysql")
    {
        //nothing here
    }

    public DbSet<Humans> Humans { get; set; }
}
Run Code Online (Sandbox Code Playgroud)

然而,我在访问数据库时收到此错误:

System.Data.Entity.Core.ProviderIncompatibleException
  HResult=0x80131501 …
Run Code Online (Sandbox Code Playgroud)

c# mysql entity-framework entity-framework-6

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