Questions tagged [tbitmap]
48 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.…
![](../../users/profiles/89691.webp)
rossmcm
- 5,184
- 7
- 51
- 108
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…
![](../../users/profiles/49925.webp)
dummzeuch
- 10,406
- 2
- 47
- 146
6
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…
![](../../users/profiles/47012.webp)
Brian Frost
- 12,964
- 10
- 72
- 146
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…
![](../../users/profiles/2561452.webp)
Robert Oschler
- 13,520
- 17
- 74
- 209
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…
![](../../users/profiles/639158.webp)
Sara S.
- 1,335
- 1
- 14
- 32
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:…
![](../../users/profiles/2591595.webp)
Blurry Sterk
- 1,493
- 9
- 16
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.
![](../../users/profiles/1458615.webp)
Loghman
- 1,481
- 1
- 11
- 27
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();
…
![](../../users/profiles/337473.webp)
Andrew
- 3,512
- 3
- 38
- 67
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…
![](../../users/profiles/102128.webp)
isa
- 1,015
- 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:…
![](../../users/profiles/46207.webp)
Z80
- 19,117
- 19
- 138
- 260
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…
![](../../users/profiles/7700685.webp)
Jim
- 35
- 6
2
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
…
![](../../users/profiles/1580348.webp)
user1580348
- 4,654
- 2
- 27
- 73
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);
…
![](../../users/profiles/2422022.webp)
shariful
- 415
- 5
- 19
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…
![](../../users/profiles/5043424.webp)
asd-tm
- 2,215
- 2
- 19
- 30
2
votes
1 answer
Strange Delphi Android image assign / image garbled issue
I have some code that works fine in iOs, but which results in completely messed up images when on Android. I have found a partial workaround (not call some code), but it hints something is terrible wrong:
// some bitmap object buffer for mainthread…
![](../../users/profiles/599361.webp)
Tom
- 3,457
- 8
- 64
- 119