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
Developing a Kernel Modul...
by
MarkMLl
[
Today
at 09:28:16 am]
C operators and shift
by
Okoba
[
Today
at 09:28:14 am]
ZDataset.Locate + loParti...
by
tintinux
[
Today
at 09:14:48 am]
Type Library Viewer, Impo...
by
Thaddy
[
Today
at 08:52:26 am]
Problem with Hints
by
Alexandr R
[
Today
at 08:20:29 am]
Storing line colors
by
Khrys
[
Today
at 07:51:29 am]
Use tts0, This example is...
by
Thaddy
[
Today
at 06:28:12 am]
Python4Lazarus Undefined ...
by
Jurassic Pork
[
Today
at 02:07:28 am]
Show Form at Top
by
TRon
[
Today
at 12:48:24 am]
Zaos Transliteration on l...
by
hamacker
[December 03, 2024, 11:12:53 pm]
Breakpoint dosn't work
by
Joanna from IRC
[December 03, 2024, 11:04:55 pm]
[SOLVED] Howto use a DEFI...
by
PascalDragon
[December 03, 2024, 09:42:38 pm]
Random SnowFlakes:
by
Boleeman
[December 03, 2024, 09:07:14 pm]
AVRPascal – free code edi...
by
ackarwow
[December 03, 2024, 09:04:00 pm]
Secondary Installation fo...
by
TRon
[December 03, 2024, 08:21:03 pm]
Error when attempting to ...
by
dsiders
[December 03, 2024, 08:01:39 pm]
The Form cannot be resize...
by
daxnet
[December 03, 2024, 02:51:42 pm]
Api/component pack for Ra...
by
MarkMLl
[December 03, 2024, 02:15:57 pm]
kernel 6.8 and checking s...
by
MarkMLl
[December 03, 2024, 02:13:41 pm]
storing string
by
Thaddy
[December 03, 2024, 09:38:41 am]
OverLapping Snowflake Fra...
by
Boleeman
[December 03, 2024, 09:04:01 am]
[SOLVED] StringGrid color...
by
Vodnik
[December 03, 2024, 08:26:44 am]
YM Player
by
TRon
[December 03, 2024, 02:32:16 am]
How single procedure ends...
by
Marion
[December 03, 2024, 01:57:43 am]
ct2laz - convertor betwee...
by
Sharfik
[December 03, 2024, 01:26:03 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: image in timage compoent won't go to transparent! (Read 3622 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: 5375
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