Questions tagged [tbitmap]
50 questions
9
votes
2 answers
Delphi - how do I crop a bitmap "in place"?
If I have a TBitmap and I want to obtain a cropped image from this bitmap, can I perform the cropping operation "in place"? e.g. if I have a bitmap that is 800x600, how can I reduce (crop) it so that it contains the 600x400 image at the centre, i.e.…

rossmcm
- 5,493
- 10
- 55
- 118
8
votes
1 answer
In Delphi, how does TBitmap.Monochrome and .PixelFormat influcence the format of .ScanLine?
I want to assign a given buffer with a bitmap in Mono8 format (Monochrome 8 Bits) to a bitmap. I then assign the resulting bitmap to a TImage component to display it. The pictures are screenshots of the resulting display.
The following code works…

dummzeuch
- 10,975
- 4
- 51
- 158
7
votes
2 answers
Is it possible to smooth a scaled TBitmap in Delphi?
I am using Stretched=True on a TImage with a 256x256 bitmap. This gets scaled down by 1,2,4 or 8. As expected, text on the bitmap gets more horrible the more I depart from '1'.
I notice though that Windows 7 explorer renders a scaled down version of…

Brian Frost
- 13,334
- 11
- 80
- 154
4
votes
1 answer
Changes to TBitmap do not appear in rendered image in Delphi 6 DirectShow filter and generates lots of soft page faults
I have a Delphi6 DirectShow filter (push source video filter) written with the DSPACK component library. I am having a truly vexing problem with some simple code that modifies a bitmap before outputting the modified bitmap to the destination media…

Robert Oschler
- 14,153
- 18
- 94
- 227
3
votes
1 answer
DIB to Tbitmap code manipulation to adapt PNG images?
I use this code to convert DIB to TBitmap, so how can i manipulate this code to be suitable to a PNG image (preseving its transparency)?
I tired to set the Transparent property to true but it seems that the code was made for 256 color bitmap.
code…

Sara S.
- 1,365
- 1
- 15
- 33
3
votes
1 answer
TBitmap looses Clipping region after non-related graphics code
Please consider the following code:
type
TBaseControl = class(TWinControl)
private
FBitmap : TBitmap;
public
constructor Create(AOwner : TComponent); override;
procedure DrawBorder;
end;
TForm1 = class(TForm)
Button1:…

Blurry Sterk
- 1,595
- 2
- 9
- 18
3
votes
1 answer
Access violation when freeing TBitmap variable -- Bitmap variable still assigned after freeing?
I have this code in a VCL Forms Application:
implementation
{$R *.dfm}
var
MyBitmap: TBitmap;
procedure TFormMain.FormCreate(Sender: TObject);
begin
MyBitmap := TBitmap.Create;
end;
procedure TFormMain.FormDestroy(Sender: TObject);
begin
…

user1580348
- 5,721
- 4
- 43
- 105
3
votes
2 answers
How can convert FMX.Graphics.TBitmap to VCL.Graphics.TBitmap or Vcl.Imaging.PngImage.TPngImage?
How a FMX.Graphics.TBitmap can be converted to VCL.Graphics.TBitmap or Vcl.Imaging.PngImage.TPngImage?
I have both FMX form and VCL form in my project.

Loghman
- 1,500
- 1
- 14
- 30
3
votes
1 answer
How to display a TBitmap with alpha channel on TImage correctly?
I have a TBitmap which contains semi-transparent image with alpha channel (in this example I got it from TPngImage).
var
SourceBitmap: TBitmap;
PngImage: TPngImage;
begin
PngImage := TPngImage.Create();
SourceBitmap := TBitmap.Create();
…

Andrew
- 3,696
- 3
- 40
- 71
3
votes
2 answers
TBitmap to TPngImage and Memory usage
I have an array of 11 white TBitmaps (32-bit 512x512 pixles = 1 MB)
and I want to assign them to TPngImage array to reduce memory usage,
I expect the 1 mb white bitmap to become 1.76 KB png and the memory usage drop dramatically
I monitored that…

isa
- 1,055
- 16
- 26
2
votes
1 answer
How to copy a gray-scale bitmap via ScanLine
I want to copy pixels from BMP1 to BMP2 but the copied image is gabbled. Why?
Note: The input image is pf8bit;
TYPE
TPixArray = array[0..4095] of Byte;
PPixArray = ^TPixArray;
procedure Tfrm1.CopyImage;
VAR
BMP1, BMP2: TBitmap;
y, x:…

Gabriel
- 20,797
- 27
- 159
- 293
2
votes
1 answer
Draw tbitmap with scale and alpha channel faster
The following code copies a large bitmap blends it with the correct background and then draws a semi transparent image with a clipped region to save draw time... Images are in an array and prescaled...
This has been through several levels of…

Jim
- 45
- 7
2
votes
1 answer
How to use DrawTransparentBitmap() in C++ Builder
Just trying to figure out how to use DrawTransparent in C++ Builder to draw a bitmap or tbitmap with an alpha channel so that the drawn image is semi-transparent with the background image.
I looked all over the place and on this site but can't…

Jim
- 45
- 7
2
votes
1 answer
Delphi TBitmap to string via TBitmapSurface and back to TBitmap
I am doing following to convert TBitmap(Firemonkey) to string:
function BitmapToBase64(Bitmap: Tbitmap): string;
var
BS: TBitmapSurface;
AStream: TMemoryStream;
begin
BS := TBitmapSurface.Create;
BS.Assign(Bitmap);
BS.SetSize(300, 200);
…

shariful
- 455
- 1
- 9
- 21
2
votes
1 answer
How to crop an FMX TBitmap
I receive a bitmap via TCameraComponent.SampleBufferReady event. Then I need to crop the received image so that I get a, for instance, recangular image.
I calculate the necessary parameters in the following method:
procedure…

asd-tm
- 3,381
- 2
- 24
- 41