Results 1 to 6 of 6

Thread: painting problem

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2009
    Posts
    376

    painting problem

    in the painteventargs of the form, i've got something like this:

    Code:
       Dim bm As New Bitmap(1, 1)
                Dim g As Graphics = Graphics.FromImage(bm)
                Me.BackColor = Color.Yellow
                g.Clear(Color.Red)
                e.Graphics.DrawImage(bm, 0, 0, 100, 100)
    i'm getting a very cool gradient effect from red to yellow, but why is that the case? shouldn't the 1x1 portion be totally red? and the remaining pixels be totally yellow?

    [edit]

    i'm not trying to paint a 1x1 portion in my form, im trying to know why e.Graphics.DrawImage(bm, 0, 0, 100, 100) doesn't draw a 1x1 red portion on my form through the code provided above.

    my understanding is that 0,0 specifies the point to draw the image. bm specifies the image actually drawn, which is 1x1 px. and 100,100 specifies the allowed space for the graphics to draw, if this is correct, the first pixel should be red and the remaning 9999 pixels should be yellow but they aren't
    Last edited by pacerier; Jan 2nd, 2010 at 10:15 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width