Region.IsEmpty() without a Graphics object



I'm not sure if anyone else has run into this but I've often found
that I wish there was a way to use the Region.IsEmpty() without having
to specify a Graphics object, i.e. an override that specifies the pixel
size. I understand that it needs it to determine the point in which a
region becomes smaller than a pixel but why can't I specify something
that tells it to just *assume* some type of scaling - e.g. my
coordinates and dimensions are in pixels. I *could* create a dummy
bitmap just to do this but that's just wrong and I can't bring
myself to do that especially because it's just a waste of memory.

My problem is that I've created an object that is once removed from
the actual graphics components for various reasons. Clients pass it
rectangles and points of what's happening and it determines what to
do with that information e.g. update various buffers and/or pass back
events of subsequent changes to the envirment. I often need to use the
Region.Intersect() method to determine whether or not a point is within
certain areas but I can't determine if the resultant intersection is
empty unless I have a Graphics object.

I've resorted to using GetRegionScans(<identity matrix>) and then
determining whether not the sum of width * height for all rectangles
is less than 1 to determine if this region resolves to less than a
pixel. This works for the most part but seems kind of messy
considering how easy and clean using Regions usually is.

I was wondering if anyone had any other thoughts about how to solve
this issue?
Or maybe this override has already been added to the next version?

.



Relevant Pages

  • Re: Bitmap collision detection in VB6
    ... rectangles calculation - simple enough, ... sprite collision detection, and it is *very fast* in a compiled exe ... does contain a black pixel then the actual sprite pixels are touching, ... bmp file. ...
    (comp.lang.basic.visual.misc)
  • Re: large images / EPSI
    ... vector graphics with a WHOLE BUNCH of tiny rectangles" ... Essentially every single pixel is drawn ... consisting of a lot of tiny rectangles, ... sensible order (though I wouldn't want to bet on that without knowing ...
    (comp.text.tex)
  • Re: page is too wide even
    ... You have nested tables, so you need to specify each table as 100%, and then ... specify the width percentage for each cell individually. ... search for "width=" and change the pixel value to a %. ... I'm getting ready to sign off, Susan, but if you need additional help, feel ...
    (microsoft.public.frontpage.programming)
  • OpenGL Correctness tips
    ... To obtain exact two-dimensional rasterization, carefully specify both the ... reliably fills the lower-left pixel of the viewport, and glRasterPos2i(0, ... model matrix because this cancels my 0.375 translation. ...
    (comp.graphics.api.opengl)
  • Re: Scale Transform - Why do I need to account for verticalResolution?
    ... DrawImageUnscaled draws the image _physically_ unscaled taking the actual size of the rectangle calculated by the resolution and the pixel dimensions of the picture. ... If you just want to output the image according to its pixel dimensions and ignore the actual physical size you must use the DrawImage variant that specifies the source, ... the desired transform on the graphics object then I would do a 1:1 ...
    (microsoft.public.dotnet.framework.drawing)