Solved

How to Change a Bitmap size form delphi 3

Posted on 1998-12-26
13
581 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
ID: 1353116
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
ID: 1353117
You just use

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

-Viktor
--Ivanov
0
 

Author Comment

by:rmloh
ID: 1353118
I now how to do it i wont to save the image in my size to a
bmp file
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
LVL 10

Expert Comment

by:viktornet
ID: 1353119
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
ID: 1353120
No i wont to save a bitmap in my size
0
 
LVL 1

Expert Comment

by:Oli2
ID: 1353121
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
 

Expert Comment

by:teechong
ID: 1353122
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
ID: 1353123
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
ID: 1353124
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
ID: 1353125
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
ID: 1353126
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
ID: 1353127
ok ok
0
 
LVL 10

Expert Comment

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

-Viktor
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Newbie Thread Programming 1 161
Run video youtube webbrowse 10 65
Delphi IDE crash without error message ... 7 99
Unique identifier on a terminal server (rdp) 4 67
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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

831 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