Solved

Image Transparency

Posted on 2002-06-07
9
285 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

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
 

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Learn how to set up basic frames and paths in Prezi and understand the open space that Prezi allows you to create presentations in.

776 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