Solved

Image Transparency

Posted on 2002-06-07
9
279 Views
Last Modified: 2013-11-19
Hi guys,
   Does anyone know of a component that allows transparency for images other than .bmp's?

Setting Transparency to true when a bitmap is loaded into a TImage component makes it transparent.  I need to do this to another image format (bitmaps are just too big to store).  Any suggestions on components and what image format to use (png, jpeg etc).
0
Comment
Question by:WoodyJ007
  • 5
  • 3
9 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7061511
you could use jpg and assign the
jpg as bitmap into the
timage.picture.bitmap-property like

jpgobject.loadfromfile('AFilename');
image1.picture.bitmap.assign(jpgobject);
//do your transparency now

meikl ;-)
0
 

Author Comment

by:WoodyJ007
ID: 7061530
I've found that converting from jpegs to bitmaps is slow and never a perfect conversion.

I'm writing some software that will have thousands of images that some of which will overlay on each other.  I need it to be as quick as possible and storage (in SQL server) to be as small as possible.

I was thinking of using Png's but I'm not sure on performance.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7061551
>I've found that converting from
>jpegs to bitmaps is slow and never
>a perfect conversion.

depends on how big is the image and
how was the compression<->quality ratio

for png you need a converter for display,
for this look for the graphicEx lib
from mike lischke at www.lischke-online.de

meikl ;-)

0
 

Author Comment

by:WoodyJ007
ID: 7061624
OK.  I think I've decided on pngs but the graphicEX lib seems to be looking for jpg.pas.  The DCU is there but it still won't run.

I'm using Delphi6 so maybe the dcu was complied under another version and isn't compatible.

Does anyone have the source for jpg.pas ??

cheers
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Expert Comment

by:Stormmin66
ID: 7062269
add JPEG to uses
0
 

Author Comment

by:WoodyJ007
ID: 7066372
I've already tried that.  It throws loads of compiler errors.  jpg.pas and jpeg.pas must be different.
0
 
LVL 27

Accepted Solution

by:
kretzschmar earned 200 total points
ID: 7066378
if you have to recreate the jpg-dcu file because graphicex
download this file from mike lischke

http://scripts.delphi-gems.com/download2.php?ID=7

meikl ;-)
0
 

Author Comment

by:WoodyJ007
ID: 7066417
Spot on!  Thanks.

It adds png support to the standard controls which make my life loads easier.

Cheers
Woody.
0
 

Author Comment

by:WoodyJ007
ID: 7066418
Spot on!  Thanks.

It adds png support to the standard controls which makes my life loads easier.

Cheers
Woody.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Many programs have tried to outwit PowerPoint in terms of technology and skill. These programs, however, still lack several characteristics that PowerPoint has possessed from the start. Here's why PowerPoint replacements won't entirely work for desi…
In this tutorial viewers will learn how to create blended and gradiated shapes in Illustrator using the blend tool Draw two shapes, one of them in a different color: Select both and create a blend by going to Object > Blend > Make: Blends can also b…
Learn how to download your full Prezi presentation for offline presenting. Prezi doesn’t have to be viewed and shared in a web browser, even with a free account you can download your full presentation to share with others. Be sure to download any vi…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now