[SOLVED] - StretchDraw Problums lazarus / 39-Graphics ---------------------------------------------------------------------- BenJones · 2013-05-31 23:14 hi , I am trying to make an editor for small 16x16 bitmaps. ok so I load a 16x16 icon in the a TImage control, now I have other TImage that has the width and height of 288, I use StretchDraw to copy the 16x16 bitmap into the bigger image. but I am seeing problems such as colors as been changed, e.g. some colours look like they been lightened or darkened. any ideas what wrong. anyway here is the code I use though I can't see anything wrong. and don't understand why it would start changing colors. Code: [Select]var   bmp: TBitmap;   r: TRect; begin   bmp := TBitmap.Create;   r.Left := 0;   r.Top := 0;   r.Right := 288;   r.Bottom := 288;   //Using this shows incorrect colors.   bmp.LoadFromFile('c:\out\demo.bmp');   imgcanvas.Canvas.StretchDraw(r,bmp);   //This works fine.   {StretchBlt(imgcanvas.Canvas.Handle, 0, 0,     288, 288, bmp.Canvas.Handle, 0, 0, 16, 16, SRCCOPY);    } ---------------------------------------------------------------------- User137 · 2013-06-01 02:54 You are using the functions differently. Right and Bottom are not the same as Width, Height. The rectangle should be (0, 0) - (287, 287). Pixel width from 0 to 288 is 289. ---------------------------------------------------------------------- BenJones · 2013-06-01 08:10 No sure what you mean I or I done something wrong, I tryed what you said the icon draws on the bigger image, but a few colors are like they been lightened StretchBlt works with no problums. any chnace you can have a look at my project I added my project so you can see the problum. Thanks. ---------------------------------------------------------------------- Jurassic Pork · 2013-06-01 09:01 hello BenJones, i have tried your project. No problem, the colors in the big image are the same that in the small. Then the question : what is your version of Lazarus, your OS ? tried on Lazarus 1.1 svn 41453  Windows 7 . Friendly, J.P ---------------------------------------------------------------------- BenJones · 2013-06-01 16:20 hi using lazarus 1.0.8 on Windows 7 ---------------------------------------------------------------------- BenJones · 2013-06-01 16:31 I just downloaded Lazarus-1.1-40379-fpc-2.6.0-20130224-win32.exe and it working fine now.