Solved

Image editor Resizing

Posted on 2000-04-12
22
233 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
[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
  • 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
Industry Leaders: 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!

 

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

733 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