PC Review


Reply
Thread Tools Rate Thread

BitMap Size vs Drawing

 
 
=?Utf-8?B?RGVubmlz?=
Guest
Posts: n/a
 
      18th Aug 2005
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.
--
Dennis in Houston
 
Reply With Quote
 
 
 
 
gjuro kladaric
Guest
Posts: n/a
 
      18th Aug 2005
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


"Dennis" <(E-Mail Removed)> wrote in message
news:E4F586EA-6C1B-42C4-85C3-(E-Mail Removed)...
>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.
> --
> Dennis in Houston



 
Reply With Quote
 
Cor Ligthert [MVP]
Guest
Posts: n/a
 
      18th Aug 2005
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


 
Reply With Quote
 
=?Utf-8?B?RGVubmlz?=
Guest
Posts: n/a
 
      18th Aug 2005
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!
--
Dennis in Houston


"gjuro kladaric" wrote:

> 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
>
>
> "Dennis" <(E-Mail Removed)> wrote in message
> news:E4F586EA-6C1B-42C4-85C3-(E-Mail Removed)...
> >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.
> > --
> > Dennis in Houston

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
'System.Drawing.Bitmap.Bitmap()' Error Fir5tSight Microsoft Dot NET 7 23rd Jun 2006 11:44 AM
GDI+ Bitmap drawing vs GDI+ PrintDocument drawing =?Utf-8?B?amxhdmFsbGV0?= Microsoft Dot NET Framework Forms 1 28th Jun 2005 08:08 AM
drawing on bitmap question Abubakar Microsoft C# .NET 1 8th Dec 2004 04:12 PM
Drawing a Control into a Bitmap Jose Microsoft Dot NET Compact Framework 4 2nd Jan 2004 08:08 PM
Bitmap drawing Crirus Microsoft VB .NET 6 15th Oct 2003 03:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:16 AM.