Solved

How to Change a Bitmap size form delphi 3

Posted on 1998-12-26
13
575 Views
Last Modified: 2010-04-04
How to Change a Bitmap size form delphi 3?
0
Comment
Question by:rmloh
13 Comments
 
LVL 17

Expert Comment

by:inthe
Comment Utility
if your using the timage component set the stretch property to true in object inspector if this gives unexceptable result i can post a unit for rescaling bitmaps
Regards Barry
0
 
LVL 10

Expert Comment

by:viktornet
Comment Utility
You just use

bmp.width := whatevervalue;
bmp.height := whatevervalue;

-Viktor
--Ivanov
0
 

Author Comment

by:rmloh
Comment Utility
I now how to do it i wont to save the image in my size to a
bmp file
0
 
LVL 10

Expert Comment

by:viktornet
Comment Utility
PLease explain yourself better next tim 'cuz I don't understand what ya mean...

Here is the way to save the bitmap....

MyBmp.SaveToFile(Filename);

-Viktor
--Ivanov
0
 

Author Comment

by:rmloh
Comment Utility
No i wont to save a bitmap in my size
0
 
LVL 1

Expert Comment

by:Oli2
Comment Utility
I think, what rmloh is trying to say is:
He wants to change the size of a Bitmap and then save it to file with the new size.

Greetings, Oli
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

Expert Comment

by:teechong
Comment Utility
You can create a temporary TBitmap, copy the stretched image (of the source) over using CopyRect or the like then save the temporary TBitmap using the SaveToFile method.

TC
0
 
LVL 10

Expert Comment

by:viktornet
Comment Utility
rmloh, I think you don't know what you are talking about. The other question you asked is messed up the same way this one is,,, YOu don't explain and just reject answers/... If you are not satisfied with the answer you should ask for further help and not just reject the answer... if I don't supply further help you just reject it then.... NExt time you bettter explain your situation 'cuz and tired of people not explaining completly what they want...

-Viktor
0
 

Author Comment

by:rmloh
Comment Utility
The anserr is excellant but can you pleas tell my how
to Stretch and save to file.
 
   
0
 
LVL 10

Accepted Solution

by:
viktornet earned 50 total points
Comment Utility
Here it is...

To save a bitmap to a file you use SaveToFile() like this...

MyBitmap.SaveToFile(PutTheFileNameInHere);

to stretch the bitmap use StretchDraw();;;;here is an example....


var
  b : TBitmap;
begin
 b := TBitmap.Create;
 b.LoadFromFile('C:\windows\desktop\test.bmp');
 b.canvas.StretchDraw(rect(0, 0, b.width shl 1, b.height shl 1), b);
 b.SaveToFile('C:\windows\desktop\stretched.bmp');
 b.Free;
end;

This should work, if it doesn't let me know and I'll do it once again and will test it. If you are not satisfied with the answer please don't reject my answer and just tell me what more you need and I'll answer your questions...

-Viktor
--Ivanov
0
 
LVL 10

Expert Comment

by:viktornet
Comment Utility
Oh, I forgot, make sure that you have a bitmap named test.bmp on your desktop in order for this to work....

-Viktor
0
 

Author Comment

by:rmloh
Comment Utility
ok ok
0
 
LVL 10

Expert Comment

by:viktornet
Comment Utility
Did it work?? If not just tell me what went wrong and I'll fix it.

-Viktor
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

744 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

13 Experts available now in Live!

Get 1:1 Help Now