我想画水族馆(容器)站在桌子上.水族馆的墙壁需要混合.
但是,如果我先画桌子,然后是水族馆,我会看到:
- 从桌子的上方
看:好的- 从桌子底部看:错了,我还是看水族馆
如果我首先绘制aquariun然后是桌子我得到:
- 从桌子的上方看:错误的,水族箱壁对桌子没有影响(虽然它们影响了背景)
- 从桌子的底部看:错了,我仍然看到水族馆
有图片解释它:
http://img213.imageshack.us/img213/6609/pictureem.jpg
代码:main.cpp
int DrawGLScene(GLvoid)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
Cam.SetPrespective();
//----------------
GLfloat LightPosition0[]= { 0.0, 0.0, 0.2, 1.0f };
GLfloat LightAmbient0[]= { 0, 0, 0, 1.0f };
GLfloat LightDiffuse0[]= { 1.0f, 1.0f, 1.0f, 1.0f };
GLfloat LightSpecular0[]= { 1.0f, 1.0f, 1.0f, 1.0f };
glLightfv(GL_LIGHT0, GL_AMBIENT, LightAmbient0); // Setup The Ambient Light
glLightfv(GL_LIGHT0, GL_POSITION,LightPosition0); // Position The Light
glLightfv(GL_LIGHT0, GL_DIFFUSE, LightDiffuse0); // Setup The Diffuse Light
glLightfv(GL_LIGHT0, GL_SPECULAR, …Run Code Online (Sandbox Code Playgroud) 如何使用在后台运行的Visual Studio 2010编写C#应用程序?我的意思是它不在控制台中运行或显示表单.我应该使用哪种类型的项目?
我有数据库存档C:\Users\Pawel\Documents\DB.sdf.我该如何连接它?
下面的简单代码不起作用并生成异常.
码:
[WebMethod]
public String TestCon()
{
SqlConnection sql = new System.Data.SqlClient.SqlConnection(
@"Data Source=C:\Users\Pawel\Documents\DB.sdf");
string str = "OK";
try
{
sql.Open();
sql.Close();
}
catch (Exception ex)
{
str = ex.Message;
}
return str;
}
Run Code Online (Sandbox Code Playgroud)
结果:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network …
我有基于本教程的应用程序
我用来从服务获取用户列表的方法:
public class PBMBService : IService
{
public ServiceResponse UserList()
{
try
{
sql.Open();
List<User> result = new List<User>();
//filling list from database
return new ServiceResponse(SRFlag.OK, result);
}
catch (Exception ex)
{
return new ServiceResponse(SRFlag.EXCEPTION, ex);
}
}
//other methods
}
Run Code Online (Sandbox Code Playgroud)
服务主要功能:
class Program
{
static void Main(string[] args)
{
Uri baseAddress = new Uri("http://localhost:8000/PBMB");
ServiceHost selfHost = new ServiceHost(typeof(PBMBService), baseAddress);
try
{
selfHost.AddServiceEndpoint(
typeof(IService),
new WSHttpBinding(),
"PBMBService");
ServiceMetadataBehavior smb = new ServiceMetadataBehavior();
smb.HttpGetEnabled = true;
selfHost.Description.Behaviors.Add(smb); …Run Code Online (Sandbox Code Playgroud) 我有PictureBox,我把它设置为BorderStyle,None但我仍然在它周围有一个边框。我怎样才能摆脱它?
还有什么细节?我的图像本身没有边框。我用代码
private void btnLoad_Click(object sender, EventArgs e)
{
if (dgOpenFile.ShowDialog() == DialogResult.OK)
{
try
{
img = new Bitmap(dgOpenFile.FileName);
picture.Size = img.Size;
picture.Image = img;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
Run Code Online (Sandbox Code Playgroud)
要打开并显示图像:
图像为 10x10。他们低于(800%)
原来的:
http://img695.imageshack.us/img695/2409/originallu.png
以及它的显示方式:
我有一个表'学生'和一个表''应用程序'.
每个学生可申请最多3门课程.我怎样才能确保在数据库中?触发?约束?
你能告诉我怎么写吗?我是SQL的新手
这是我的代码.当我将光标移动到Form上时,圆圈正在移动,但它正在闪烁.我怎样才能解决这个问题?
public partial class Preprocesor : Form
{
int x, y;
Graphics g;
public Preprocesor()
{
InitializeComponent();
}
private void Preprocesor_Load(object sender, EventArgs e)
{
g = pnlMesh.CreateGraphics();
}
private void pnlMesh_Paint(object sender, PaintEventArgs e)
{
g.Clear(Color.White);
g.FillEllipse(Brushes.Black, x, y, 10, 10);
}
private void pnlMesh_MouseMove(object sender, MouseEventArgs e)
{
x = e.X;
y = e.Y;
pnlMesh.Invalidate();
}
}
Run Code Online (Sandbox Code Playgroud) using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Net.Mail;
using System.Threading;
namespace MGR_Backuper
{
class Program
{
static void Main(string[] args)
{
string file = "D:\\Programy\\WinRAR\\rar.exe";
string command = "C:\\Users\\Pawel\\Desktop\\Praca magisterska back\\mgrback-%YEAR%-%MONTH%-%DAY%-%HOUR%-%MINUTES%-%SECONDS%.rar";
string arg = "a \"%FILENAME%\" \"C:\\Users\\Pawel\\Desktop\\Praca magisterska\\*\" -m5 -ep1 -hppasspass -rr5 -inul -r0";
var t1 = DateTime.Now;
command = command.Replace("%YEAR%", "" + t1.Year);
if (t1.Month < 10) command = command.Replace("%MONTH%", "0" + t1.Month);
else command = command.Replace("%MONTH%", "" + t1.Month);
if (t1.Day < …Run Code Online (Sandbox Code Playgroud) c# ×6
winforms ×2
blend ×1
drawing ×1
email ×1
opengl ×1
panel ×1
picturebox ×1
postgresql ×1
sql-server ×1
wcf ×1
web-services ×1