BitMap Size vs Drawing

G

Guest

I create a bitmap of 12 pixels wide x 15 pixels high then create a graphics
object from the bit map. When I draw a rectangle g.DrawRectangle(blackpen,
new rectangle(0,0,12,15)), I get the top and side but the far side and bottom
are not drawn. If I draw a rectangle g.DrawRectangle(blackpen, new
rectangle(0,0,11,14) then all four sides are drarwn.

I am having trouble understanding why I can't get a rectangle 12 pixels wide
by 15 pixels high drawn on the bitmap border.
 
G

gjuro kladaric

hi,

is not it true that a bitmap 12 x 15 pixels contains pixels addressable as
(0-11) x (0-14)

so, drawing rectangle (0, 0, 12, 15) draws outside of the bitmap

it is unlike vb where array(15) actually contains 16 elements

I hope this helps

gjuro
 
C

Cor Ligthert [MVP]

Dennis,

I think that you get your answer the quickest in the newsgroup.

Microsoft.public.dotnet.framework.drawing

I hope you find your solution soon

Cor
 
G

Guest

I thought that the width and height in the .drawrectangle method were a count
of the number of pixels to draw, not index of pixels!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top