Re: create a clone of an existing Bitmap without using the clone method.



The final size of an image depends on the declared resolution. When you draw
an image, ideally you should use the DrawImage method that enables you to
specify the Pixel GraphicsUnit otherwise the image will be adjusted for
differences in the screen DPI and image DPI.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.



" **Developer**" <REMOVEdeveloper@xxxxxxxxxx> wrote in message
news:OcmqQF6GGHA.1760@xxxxxxxxxxxxxxxxxxxxxxx
> DrawImage(Image, Point)
>
> Draws the specified Image object, using its original physical size, at the
> specified location.
>
> I just want the image drawn on the bitmap with the new pixels simply a
> copy of the old pixels.
>
> That is, pixel for pixel, the original and the drawn images should be the
> same.
>
> Will the above do that (unsure about what physical size means)
>
>
>
> Actually I simply want to create a clone of an existing Bitmap (zz)
> without using the clone method.
>
> Dim TmpBitmap = New Drawing.Bitmap(zz)
>
> Dim TmpBitmapGr As Graphics = Graphics.FromImage(TmpBitmap)
>
> TmpBitmapGr.DrawImage(zz, new point(0,0))
>
>
>
> Will this do that?
>
>
>
>
>
> Thanks
>
>


.



Relevant Pages

  • Re: Problems with the graphics class
    ... greyscale or indexed tiff image the values of the pixel gets shifted ... method with pixel as graphicsunit but it doesn't help. ... Find great Windows Forms articles in Windows Forms Tips and Trickshttp://www.bobpowell.net/tipstricks.htm ... I'm trying to use the DrawImage method using the upperleftcorner copy ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: Anti-aliased drawing
    ... The problem will be modifying it to draw arc's, ... Dim ErrorAdj As Long, ErrorAcc As Long ... Dim ErrorAccTemp As Long, Weighting As Long ... ' Draw the initial pixel, ...
    (microsoft.public.vb.general.discussion)
  • Re: Fast and simple way to determine bounds of difference...
    ... That should help with the basic transfer of pixel data. ... rectangle of the image difference, ... Find great Windows Forms articles in Windows Forms Tips and Tricks ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: Draw pixel
    ... picture box, but instead draw right onto the form. ... simple example, I would want to draw a square, pixel by pixel to the ... Private Declare Function SetPixel Lib "gdi32" _ ...
    (comp.lang.basic.visual.misc)
  • Re: GDI+, Pens and Draw*** methods
    ... will draw inside the rectangle. ... > code wholesale to GDI+. ... > Find great Windows Forms articles in Windows Forms Tips and Tricks ... >> Equals a 101 pixel wide box since 0 also counts as a pixel. ...
    (microsoft.public.dotnet.framework.drawing)

Loading