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
Solved

Image editor Resizing

Posted on 2000-04-12
22
231 Views
Last Modified: 2010-04-02
I am working on an image editor in visual c++. I want to resize the image.
so what will be code for that.
0
Comment
Question by:Barry01
  • 12
  • 10
22 Comments
 
LVL 23

Accepted Solution

by:
chensu earned 300 total points
ID: 2709966
You can use the following functions.

StretchBlt
StretchDIBits
SetStretchBltMode
0
 

Author Comment

by:Barry01
ID: 2709995
can I specify the particular size of the image like 340 210 into 480 320

also if you can elaborate the code little bit more thanx.
0
 
LVL 23

Expert Comment

by:chensu
ID: 2710046
0
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.

 

Author Comment

by:Barry01
ID: 2710064
will there be same procedure if I want to resize the frames of an .avi file so that the avi file is resized.

0
 
LVL 23

Expert Comment

by:chensu
ID: 2710216
That's a different story. Are you playing the AVI file? Or are you editting the AVI file?
0
 

Author Comment

by:Barry01
ID: 2712604
I am compressing the avi file and while doing that I want to resize it.
0
 

Author Comment

by:Barry01
ID: 2712647
also I am using the structure bitmapinfoheader.
0
 

Author Comment

by:Barry01
ID: 2712661
actually it's avistreaminfo
0
 
LVL 23

Expert Comment

by:chensu
ID: 2712688
Yes, you can resize it. But there is no need to resize it since the AVI can be resized easily when being played.
0
 

Author Comment

by:Barry01
ID: 2712715
how to do the resizing of the avi
0
 
LVL 23

Expert Comment

by:chensu
ID: 2713264
When using the MCIWnd window class to play an AVI, simply use the MCIWndPutDest macro.
0
 

Author Comment

by:Barry01
ID: 2713280
If I want to compress it and save it in the different size.
0
 
LVL 23

Expert Comment

by:chensu
ID: 2713312
Then you resize the bitmaps of each frame using those functions.
0
 

Author Comment

by:Barry01
ID: 2713499
what is that HDC handle in the StretchDIBit function and how to use it
0
 
LVL 23

Expert Comment

by:chensu
ID: 2713532
StretchDIBits resizes the DIB and displays the result to the device context specified by the HDC. You may use a memory DC to hold the result.
0
 

Author Comment

by:Barry01
ID: 2713584
How to use it and then copy the result to the bitmapinfoheader
0
 
LVL 23

Expert Comment

by:chensu
ID: 2714082
It seems that you are not familiar with Windows GDI functions. I would suggest you take a look at the documentation/samples and some books on GDI first. Otherwise, it is difficult for you to write an image editor.
0
 

Author Comment

by:Barry01
ID: 2714101
actually the program is already written and I just want to add this function into it.
0
 

Author Comment

by:Barry01
ID: 2714149
AVIStreamReadFormat(m_apstAviStreams[iStream], 0, &m_abyBuffer, &lSize);

lpBmpInfoHdrOld = (LPBITMAPINFOHEADER)&m_abyBuffer;

can we change the width and breadth of this lpBmpInfoHdrOld with that function.
0
 
LVL 23

Expert Comment

by:chensu
ID: 2714318
It is not so easy. You have to extract each frame, resize it and assemble them again. The following sample is useful to you.

AVIedit: Editing APIs in AVIfile
http://msdn.microsoft.com/isapi/msdnlib.idc?theURL=/library/devprods/vs6/visualc/vcsample/vcsmpaviedit.htm

Class for writing your own AVI-Files
http://www.codeguru.com/multimedia/writeavi.shtml

An auto-sizing bitmap picture control
http://www.codeguru.com/bitmap/bitmap_picture.shtml
0
 

Author Comment

by:Barry01
ID: 2716746
can you give me the outline of function to perform this I will try to implement it.
0
 
LVL 23

Expert Comment

by:chensu
ID: 2716793
You may first try extracting frame bitmaps from an AVI and assembling them into an AVI without any modifications. Next, you may try doing some operations on the bitmaps.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
computer science syllabus 3 89
I could not build boost code, 10 95
Add values of each row in an array 3 64
show out valin of json for debugging in visaul c++ 1 41
When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

839 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