Adding pixels to the left/upper side of TImage

Adding pixels to the left/upper side of TImage

Post by Juhani Pirttilaht » Mon, 23 Jun 2003 20:44:52



Hello, i have problems with shifting image when i need to add pixels to
left/upper side of TImage.

I need to move whole image right by 256 pixels to add 256 pixels to left
side and same thing to add pixels to upper side..

Image can be really large (like 10000x5000 pixels)

This code (and some other ways..) does not work:

  Graphics::TBitmap *pBitmap = new Graphics::TBitmap();

  pBitmap->Height = Kuva->Height;
  pBitmap->Width = Kuva->Width;

  pBitmap->Canvas->CopyRect(pBitmap->Canvas->ClipRect, Kuva->Canvas,
Kuva->Canvas->ClipRect);

  Kuva->Width += 256;

  Kuva->Canvas->Draw(0, 256, pBitmap);

  pBitmap->Free();

 
 
 

Adding pixels to the left/upper side of TImage

Post by Maynard Philbroo » Tue, 24 Jun 2003 01:06:27


 try that ..

procedure TForm1.BitBtn1Click(Sender: TObject);
Var
 R:Trect;
begin
 r := image1.canvas.cliprect;
 Windows.scrolldc(image1.canvas.handle, 10,10,R,R,0,nil);
 image1.repaint;
end;


> Hello, i have problems with shifting image when i need to add pixels to
> left/upper side of TImage.

> I need to move whole image right by 256 pixels to add 256 pixels to left
> side and same thing to add pixels to upper side..

> Image can be really large (like 10000x5000 pixels)

> This code (and some other ways..) does not work:

>   Graphics::TBitmap *pBitmap = new Graphics::TBitmap();

>   pBitmap->Height = Kuva->Height;
>   pBitmap->Width = Kuva->Width;

>   pBitmap->Canvas->CopyRect(pBitmap->Canvas->ClipRect, Kuva->Canvas,
> Kuva->Canvas->ClipRect);

>   Kuva->Width += 256;

>   Kuva->Canvas->Draw(0, 256, pBitmap);

>   pBitmap->Free();


 
 
 

1. Icons w/extra pixel in upper left

While using Image Editor 3.0 which came with BCB3 under NT and 98:

New 16x16 256 16 color Icons sometimes exhibit a single pixel in the
upper-left corner in Test mode.

While in BCB3, loading an icon into an imagelist causes the same extra pixel
to be added to the copy created inside the imagelist.

Thanks.  Chris.

2. REYES ALGORITHM

3. Right Side vs Left Side Controls For Web Pages

4. OpenGL Programming Guide (redbook)

5. Texture Mapping -- Aligning Left side with Right side

6. NEWEST SOFTWRAEZ FROM NORMAN

7. Inverse of upper left 3x3?

8. HELP: Wavelet using for compression

9. how to create left/upper "outline"

10. remove upper left corner data

11. little boxes in upper left corner of images

12. AI6/7, 0,0 is at upper left corner of page

13. Inverse of upper left 3x3?