Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Free Pascal
»
Beginners
(Moderators:
FPK
,
Tomas Hajny
) »
image in timage compoent won't go to transparent!
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Create DB
by
comdora
[
Today
at 07:37:05 am]
Newbie in Web Programming...
by
incendio
[
Today
at 04:02:38 am]
Named range
by
backprop
[
Today
at 03:09:07 am]
FPC Deluxe doesn't work
by
TRon
[
Today
at 02:06:21 am]
Boolean type
by
440bx
[
Today
at 01:45:29 am]
[SOLVED] WebP images and ...
by
TRon
[
Today
at 01:23:47 am]
Knob Finger Spinner Graph...
by
SandyG
[
Today
at 12:40:58 am]
Using a custom record as ...
by
ilowry
[April 21, 2025, 09:13:00 pm]
Testing with SQLite3DataS...
by
dseligo
[April 21, 2025, 08:59:22 pm]
Best way to exchange data...
by
Hansvb
[April 21, 2025, 08:36:43 pm]
BGRA Shader Sphere Map
by
d2010
[April 21, 2025, 06:27:14 pm]
MVP made easier.
by
cdbc
[April 21, 2025, 05:38:10 pm]
Reading data files that a...
by
OC DelGuy
[April 21, 2025, 05:12:29 pm]
ToDoList package, support...
by
cdbc
[April 21, 2025, 04:46:00 pm]
macOS 15.4 Breaks All Com...
by
moinsen
[April 21, 2025, 04:16:24 pm]
Cannot execute Lazarus ID...
by
robert rozee
[April 21, 2025, 03:26:10 pm]
Recamán's Sequence Curve ...
by
TRon
[April 21, 2025, 03:05:03 pm]
HTMLViewer JavaScript dem...
by
myisjwj
[April 21, 2025, 02:22:46 pm]
How to DIY a filerec reco...
by
TYDQ
[April 21, 2025, 10:58:11 am]
Error: Illegal parameter:...
by
daniel_sap
[April 21, 2025, 06:45:47 am]
Times Tables Curves: Some...
by
Boleeman
[April 21, 2025, 04:45:52 am]
accessing array members i...
by
TRon
[April 21, 2025, 01:01:35 am]
RGB Plasma
by
Gigatron
[April 20, 2025, 11:26:28 pm]
Lectura puerto serie
by
Edson
[April 20, 2025, 07:42:47 pm]
Compile Error on Assign f...
by
marcov
[April 20, 2025, 03:10:08 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: image in timage compoent won't go to transparent! (Read 3852 times)
Mariner1
Newbie
Posts: 1
image in timage compoent won't go to transparent!
«
on:
July 05, 2017, 05:39:01 am »
Hi All! New to all this. I put a timage on a form, loaded a bitmap, set transparent to true but don't get a transparent background. Can someone set me right on this? Thanks.
Logged
Handoko
Hero Member
Posts: 5400
My goal: build my own game engine using Lazarus
Re: image in timage compoent won't go to transparent!
«
Reply #1 on:
July 05, 2017, 06:46:48 am »
Hello Mariner1,
Welcome to the forum.
Please provide your code and the image for use to check. It could be something wrong with your code or the image.
You can download and try my transparent.zip. I tested on Linux64, it worked correctly opening transparent png file.
Code: Pascal
[Select]
[+]
[-]
unit
Unit1
;
{$mode objfpc}{$H+}
interface
uses
SysUtils
,
Forms
,
Graphics
,
Dialogs
,
ExtCtrls
,
StdCtrls
;
type
{ TForm1 }
TForm1
=
class
(
TForm
)
btnBackground
:
TColorButton
;
btnLoad
:
TButton
;
Image1
:
TImage
;
OpenDialog1
:
TOpenDialog
;
procedure
btnBackgroundColorChanged
(
Sender
:
TObject
)
;
procedure
btnLoadClick
(
Sender
:
TObject
)
;
procedure
FormCreate
(
Sender
:
TObject
)
;
end
;
var
Form1
:
TForm1
;
implementation
{$R *.lfm}
{ TForm1 }
procedure
TForm1
.
btnLoadClick
(
Sender
:
TObject
)
;
begin
if
not
(
OpenDialog1
.
Execute
)
then
Exit
;
try
Image1
.
Picture
.
LoadFromFile
(
OpenDialog1
.
FileName
)
;
except
on E
:
Exception
do
ShowMessage
(
'Cannot open file.'
)
;
end
;
end
;
procedure
TForm1
.
FormCreate
(
Sender
:
TObject
)
;
begin
btnBackgroundColorChanged
(
Self
)
;
end
;
procedure
TForm1
.
btnBackgroundColorChanged
(
Sender
:
TObject
)
;
begin
Form1
.
Color
:
=
btnBackground
.
ButtonColor
;
end
;
end
.
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Free Pascal
»
Beginners
(Moderators:
FPK
,
Tomas Hajny
) »
image in timage compoent won't go to transparent!
TinyPortal
© 2005-2018