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
Practical Ways to Help La...
by
PascalDragon
[
Today
at 09:13:30 pm]
A problem with ptcmouse
by
TRon
[
Today
at 09:13:00 pm]
Lazarus Release 4.0
by
CM630
[
Today
at 09:04:02 pm]
Why there is no build-in ...
by
Nimbus
[
Today
at 08:50:15 pm]
Feature request/suggestio...
by
440bx
[
Today
at 08:05:11 pm]
Feature request/suggestio...
by
440bx
[
Today
at 07:58:33 pm]
Build mode Help button do...
by
440bx
[
Today
at 07:54:27 pm]
TSynCompletion failing wh...
by
Martin_fr
[
Today
at 06:55:20 pm]
How to convert TStrings t...
by
Remy Lebeau
[
Today
at 06:35:35 pm]
Animated Oscillating Line...
by
Nitorami
[
Today
at 05:57:07 pm]
3D Dot Ball
by
Dzandaa
[
Today
at 05:43:47 pm]
FPC 3.2.2 + NASM Windows ...
by
paule32
[
Today
at 05:08:38 pm]
Why isn't Lazarus / Free ...
by
JD
[
Today
at 04:39:44 pm]
BGRAGtkBitmap
by
Fred vS
[
Today
at 04:01:29 pm]
[SOLVED] Added components...
by
Rico54
[
Today
at 03:27:20 pm]
I can write your README.m...
by
PeterBB
[
Today
at 03:15:57 pm]
[SOLVED] How to "Jump To"...
by
paweld
[
Today
at 02:40:52 pm]
PZ_Nes emulator
by
Ñuño_Martínez
[
Today
at 02:29:40 pm]
Problems with Word
by
loaded
[
Today
at 02:17:56 pm]
Handle double click on a ...
by
rich2014
[
Today
at 01:49:23 pm]
Selecting Memo lines drif...
by
munair
[
Today
at 12:57:29 pm]
Question for people who h...
by
Lenny33
[
Today
at 12:57:17 pm]
project - count source li...
by
munair
[
Today
at 10:09:39 am]
[SOLVED] Anyone can tell ...
by
CharlyTango
[
Today
at 08:50:19 am]
Anyone into mDNS?
by
MaxM74
[
Today
at 08:29:16 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: image in timage compoent won't go to transparent! (Read 3868 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: 5425
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