From: Random on
On Nov 5, 4:26 pm, Loren Pechtel <lorenpech...(a)hotmail.invalid.com>
wrote:
> Since this is graphical code how can I post something that would
> actually compile?  The form itself is not going to be in the file.

For the purposes of a postable example, of course it could be. Even
if it doesn't bear an resemblence to your application, it's often
helpful to go through this excercise even just to help you debug a
problem. Here's a simple self contained form that compiles and draws
a bunch of vertical lines. If this demostrated a bug, anyone else
here could run it and see the bug for themselves.

using System;
using System.Windows.Forms;
using System.Drawing;

namespace Example
{
public partial class ExampleForm : Form
{
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new ExampleForm());
}

public ExampleForm()
{
Paint += new PaintEventHandler(ExampleForm_Paint);
}

void ExampleForm_Paint(object sender, PaintEventArgs e)
{
e.Graphics.Clear(Color.White);

for (int x = 0; x < ClientSize.Width; x += 2)
{
e.Graphics.DrawLine(Pens.Black, x, 0, x,
ClientSize.Height);
}
}
}
}
From: Peter Duniho on
Loren Pechtel wrote:
>> [...]
>> In other words: you have yet to post a proper, useful
>> concise-but-complete code example.
>
> Since this is graphical code how can I post something that would
> actually compile?

You can do it the exact same way I did.

> The form itself is not going to be in the file.

It will if you put it there.

Pete
From: Loren Pechtel on
On Thu, 5 Nov 2009 17:23:45 -0800 (PST), Random
<random.coder(a)gmail.com> wrote:

>On Nov 5, 4:26�pm, Loren Pechtel <lorenpech...(a)hotmail.invalid.com>
>wrote:
>> Since this is graphical code how can I post something that would
>> actually compile? �The form itself is not going to be in the file.
>
>For the purposes of a postable example, of course it could be. Even
>if it doesn't bear an resemblence to your application, it's often
>helpful to go through this excercise even just to help you debug a
>problem. Here's a simple self contained form that compiles and draws
>a bunch of vertical lines. If this demostrated a bug, anyone else
>here could run it and see the bug for themselves.

Don't you need the form information also? There's stuff in my test
directory that isn't in this file.

>
>using System;
>using System.Windows.Forms;
>using System.Drawing;
>
>namespace Example
>{
> public partial class ExampleForm : Form
> {
> [STAThread]
> static void Main()
> {
> Application.EnableVisualStyles();
> Application.SetCompatibleTextRenderingDefault(false);
> Application.Run(new ExampleForm());
> }
>
> public ExampleForm()
> {
> Paint += new PaintEventHandler(ExampleForm_Paint);
> }
>
> void ExampleForm_Paint(object sender, PaintEventArgs e)
> {
> e.Graphics.Clear(Color.White);
>
> for (int x = 0; x < ClientSize.Width; x += 2)
> {
> e.Graphics.DrawLine(Pens.Black, x, 0, x,
>ClientSize.Height);
> }
> }
> }
>}
From: Random on
On Nov 5, 9:21 pm, Loren Pechtel <lorenpech...(a)hotmail.invalid.com>
wrote:
> Don't you need the form information also?  There's stuff in my test
> directory that isn't in this file.

My crystal ball is murky. I don't know what stuff you're talking
about. When you create a form in a designer, it generally creates 3
files, two source files and one XML file for storying resources.

The csharp compilier takes source files. Unless you've got a specific
binary resource file (i.e., images), there's no reason you can't open
the source files and post them here. After workign through the
excersize of removing any excess code, of course.
From: vanderghast on
As you said, it is between the bitmap, which is ok, and the screen. That
betweeness includes the video card and the monitor driver. If you captured
the image, you read what is in the video card (I assume the monitor memory
is write only in most cases), and it seems to prove that the image is ok
there too. So even if you are in native resolution, maybe you use generic
driver for the monitor, rather than the manufacturer one? Furthermore, as
proven by the image I posted (which was captured by an external camera),
your code ***works*** fine. Can you try on another PC?


A texture can repeats itself (wrap mode) to fill variable size area, rather
than being limited to enlarge its original 'pixels' to fit the area, and
will even fill convex area with matching the pattern (example, painting a
T, the texture in the steam is aligned with the texture in the flanges,
automatically... if you use the same brush to paint). See "Pro .Net 2.0
Graphics Programming", by Eric White, at Apress, pp49+



Vanderghast, Access MVP



"Loren Pechtel" <lorenpechtel(a)hotmail.invalid.com> wrote in message
news:OOcbofnXKHA.3696(a)TK2MSFTNGP02.phx.gbl...
> On Thu, 5 Nov 2009 14:02:53 -0500, "vanderghast" <vanderghast(a)com>
> wrote:
>
>>Try to change the resolution then.
>
> It's native and when I save the image and load it with the Windows
> picture viewer it works. Thus it's not the monitor but something
> that's happening between the bitmap and the screen.
>
>>Or use a texture brush.
>
> What good would that do? (Not that it would work anyway--the stripes
> aren't always the same length as each other.)

First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5 6 7 8
Prev: URGENT
Next: DataRow InsertAt Database