473,324 Members | 2,268 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

BitMap Size vs Drawing

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
Nov 21 '05 #1
3 1639
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" <De****@discussions.microsoft.com> wrote in message
news:E4**********************************@microsof t.com...
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

Nov 21 '05 #2
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
Nov 21 '05 #3
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" <De****@discussions.microsoft.com> wrote in message
news:E4**********************************@microsof t.com...
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


Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Steve Amey | last post by:
Hi all I have an ARGB value for a Colour (Eg. -65536. The value was retrieved by using the Color.ToArgb method), is there any way that I can create a System.Drawing.Image or a...
1
by: someone | last post by:
Please bear with me, since I'm an ASP guy, and not a .NET guy. On my site, I dynamically resize/resample images so they're not too large. GetThumbnail resulted in very poor quality, so I create a...
2
by: active | last post by:
Problem: The PictureBox display appears to have the image cut off. I.e., the image bottom does not display although the PictureBox has room for it. It occurred to me that what was displayed was...
1
by: Claire Greenfield | last post by:
I have a vb dotnet program which uses bitmaps. The following line of code works fine for most situations: aBitmap = New Bitmap((100 / mZoom) * mBitmap.Width, (100 / mZoom) * mBitmap.Height,...
2
by: Peter Proost | last post by:
Hi group I have the following piece of code that should resize the bitmap in a picture box but it doesn't work as I tought it would. Can someone help me with it? thnx Peter Public Class...
2
by: Mad Scientist Jr | last post by:
I have a bitmap (32 pixels high, 8192 pixels wide) that contains 255 images, each 32 pixels wide, that I would like to chop up into individual 32x32 bitmap files. Rather than spending hours in...
10
by: pcnerd | last post by:
I'm a VB.NET newbie. I've created a program that plots pixels at random on the form. I have a 19" LCD monitor with a resolution set to 1280 by 1024. If you do the math, that means that there are...
1
by: Smokey Grindel | last post by:
I have a bitmap object I want to return as a JPEG image with a compression set at 90% and progressive passes enabled, how can I do this in .NET 2.0? Progressive passes are not necessary but the...
7
by: RB0135 | last post by:
Hi All, I have some Windows BMP, 1BPP, monochrome files that I need to get the raw data from to load a graphics buffer on a Roll Printer (which I know can be done). Lets forget about the Roll...
1
by: martinsmith160 | last post by:
Hi all I am trying to create a level builder tool for a final year project and im having some problems drawing. I have placed a picture box within a panel so i can scroll around the image which is...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.