Click here to Skip to main content
15,902,938 members
Home / Discussions / C#
   

C#

 
GeneralRe: join Pin
Pete O'Hanlon15-Apr-09 1:43
mvePete O'Hanlon15-Apr-09 1:43 
GeneralRe: join Pin
sheemap15-Apr-09 1:47
sheemap15-Apr-09 1:47 
GeneralRe: join Pin
Luc 64801115-Apr-09 2:02
Luc 64801115-Apr-09 2:02 
GeneralRe: join Pin
EliottA15-Apr-09 3:13
EliottA15-Apr-09 3:13 
GeneralRe: join Pin
0x3c015-Apr-09 4:30
0x3c015-Apr-09 4:30 
RantRe: join Pin
musefan15-Apr-09 2:34
musefan15-Apr-09 2:34 
AnswerRe: join Pin
tom57200715-Apr-09 2:53
tom57200715-Apr-09 2:53 
Questionproblem in setting backround image to a form created using OpenGL in c# Pin
raesa15-Apr-09 1:34
raesa15-Apr-09 1:34 
Hi,

I have a small problem.I have created a form using OpenGL controls.My task is to set an image file as background to the form.I am able to set the image when the form is loading but my image is flickering on the form.I dunnow what to do.Please have a look at my code below and do tel me what is the mistake there.

code :

public Form1()
{
sName = "C:\\Winter.jpg";
InitializeComponent();
simpleOpenGlControl1.InitializeContexts();

nFstFime = 0;
Gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
simpleOpenGlControl1.BackgroundImage = Image.FromFile(sName);
Gl.glMatrixMode(Gl.GL_PROJECTION);
Gl.glLoadIdentity();
Glu.gluOrtho2D(0, simpleOpenGlControl1.Width, 0, simpleOpenGlControl1.Height);
}

private void simpleOpenGlControl1_Paint_1(object sender, PaintEventArgs e)
{
Gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
Gl.glClear(Gl.GL_COLOR_BUFFER_BIT | Gl.GL_DEPTH_BUFFER_BIT);
if (nFstFime == 0)
{
b = new Bitmap(simpleOpenGlControl1.Width, simpleOpenGlControl1.Height);
nFstFime++;
}
b = (Bitmap)Image.FromFile(sName);
simpleOpenGlControl1.BackgroundImage = b;
Graphics g = e.Graphics;
g.DrawImage(Image.FromFile(sName), new Rectangle(0, 0, simpleOpenGlControl1.Width, simpleOpenGlControl1.Height));

}


Thnx,
Raesa
Questionhow to write string in PDF Pin
wasimsharp15-Apr-09 1:10
wasimsharp15-Apr-09 1:10 
AnswerRe: how to write string in PDF Pin
stancrm15-Apr-09 1:18
stancrm15-Apr-09 1:18 
GeneralRe: how to write string in PDF Pin
wasimsharp15-Apr-09 18:23
wasimsharp15-Apr-09 18:23 
AnswerRe: how to write string in PDF Pin
tom57200715-Apr-09 2:56
tom57200715-Apr-09 2:56 
Questionmultithreading: lock (static) function library Pin
rpm820015-Apr-09 0:58
rpm820015-Apr-09 0:58 
AnswerRe: multithreading: lock (static) function library Pin
Moreno Airoldi15-Apr-09 3:22
Moreno Airoldi15-Apr-09 3:22 
AnswerRe: multithreading: lock (static) function library Pin
PIEBALDconsult15-Apr-09 6:29
mvePIEBALDconsult15-Apr-09 6:29 
GeneralRe: multithreading: lock (static) function library Pin
rpm820015-Apr-09 22:56
rpm820015-Apr-09 22:56 
QuestionSQL Script Pin
kibromg15-Apr-09 0:54
kibromg15-Apr-09 0:54 
AnswerRe: SQL Script Pin
tom57200715-Apr-09 0:57
tom57200715-Apr-09 0:57 
GeneralRe: SQL Script Pin
kibromg15-Apr-09 1:06
kibromg15-Apr-09 1:06 
GeneralRe: SQL Script Pin
kibromg15-Apr-09 1:16
kibromg15-Apr-09 1:16 
GeneralRe: SQL Script Pin
Skymir15-Apr-09 2:35
Skymir15-Apr-09 2:35 
AnswerRe: SQL Script Pin
Dino Mulahusic15-Apr-09 1:05
professionalDino Mulahusic15-Apr-09 1:05 
GeneralRe: SQL Script Pin
kibromg15-Apr-09 1:07
kibromg15-Apr-09 1:07 
GeneralRe: SQL Script Pin
Dino Mulahusic15-Apr-09 1:09
professionalDino Mulahusic15-Apr-09 1:09 
GeneralRe: SQL Script Pin
kibromg15-Apr-09 1:13
kibromg15-Apr-09 1:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.