Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Convert to bmp

Posted on 1999-07-29
11
Medium Priority
?
251 Views
Last Modified: 2013-11-19
I need to convert images to bmp to be able to set them as wallpaper... Is there a freeware component that does the job or what should I do? I need to be able to convert from the most usual image formats: .BMP|.GIF|.JPG|.JPEG|.EMF|.WMF
0
Comment
Question by:jonassondaniel
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
11 Comments
 

Expert Comment

by:zeko
ID: 1391907
try this (NOTE! try to find component for GIF Images, it's
called TGIFImage 2.2, I am not sure for the URL)

var JPG:TJPEGImage;
    BMP:TBitmap;
begin
 JPG:=TJPegImage.Create;
 JPG.LoadFromFile('test.jpg');
 BMP:=TBitmap.Create;
 BMP.Assign(JPG);
 BMP.SaveToFile('test.bmp');
end;

Cheers, Zeko
0
 

Author Comment

by:jonassondaniel
ID: 1391908
like I said.. I need to convert from more than jpg files.
0
 

Author Comment

by:jonassondaniel
ID: 1391909
I have the TGifImage component so the gif shouldn't be a problem either. Thanks for the jpg-code. It would be great if you could help me with the other formats as well. otherwise I'll give you your point anyways.. :-)
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 13

Expert Comment

by:Epsylon
ID: 1391910
This support all formats except GIF:

var p: TPicture;
begin
  p := TPicture.Create;
  p.LoadFromFile('image.jpg'); //can be jpeg, jpg, bmp, ico, emf or wmf
  Canvas.Draw(10, 10, p.Graphic);
  p.Free;
end;


Epsylon.
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 1391911
If you want to save it to a bitmap use this:


var p: TPicture;
    b: TBitmap;
begin
  b := TBitmap.Create;
  p := TPicture.Create;
  p.LoadFromFile('mailusa.wmf');
  b.Width := p.Graphic.Width;
  b.Height := p.Graphic.Height;
  b.Canvas.Draw(0, 0, p.Graphic);
  b.SaveToFile('bitmap.bmp');
  p.Free;
  b.Free;
end;


Eps.
0
 

Author Comment

by:jonassondaniel
ID: 1391912
Hmmm... I'm a little slow... Could you change the example to open a wmf and then save it as a bmp? sorry...
0
 

Author Comment

by:jonassondaniel
ID: 1391913
:-)

you're quick!

thanks! propose answer...
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 1391914
Reject the current answer first   :o)
0
 
LVL 13

Accepted Solution

by:
Epsylon earned 200 total points
ID: 1391915
The answer is:

var p: TPicture;
    b: TBitmap;
begin
  b := TBitmap.Create;
  p := TPicture.Create;
  p.LoadFromFile('mailusa.wmf');
  b.Width := p.Graphic.Width;
  b.Height := p.Graphic.Height;
  b.Canvas.Draw(0, 0, p.Graphic);
  b.SaveToFile('bitmap.bmp');
  p.Free;
  b.Free;
end;


Cheers,

Eps.
0
 

Author Comment

by:jonassondaniel
ID: 1391916
thanks!
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 1391917
Thank you too for the points!

Next question  :o)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
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…
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.

715 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