Link to home
Start Free TrialLog in
Avatar of Barry01
Barry01

asked on

Image editor Resizing

I am working on an image editor in visual c++. I want to resize the image.
so what will be code for that.
ASKER CERTIFIED SOLUTION
Avatar of chensu
chensu
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Barry01
Barry01

ASKER

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.
Avatar of Barry01

ASKER

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

That's a different story. Are you playing the AVI file? Or are you editting the AVI file?
Avatar of Barry01

ASKER

I am compressing the avi file and while doing that I want to resize it.
Avatar of Barry01

ASKER

also I am using the structure bitmapinfoheader.
Avatar of Barry01

ASKER

actually it's avistreaminfo
Yes, you can resize it. But there is no need to resize it since the AVI can be resized easily when being played.
Avatar of Barry01

ASKER

how to do the resizing of the avi
When using the MCIWnd window class to play an AVI, simply use the MCIWndPutDest macro.
Avatar of Barry01

ASKER

If I want to compress it and save it in the different size.
Then you resize the bitmaps of each frame using those functions.
Avatar of Barry01

ASKER

what is that HDC handle in the StretchDIBit function and how to use it
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.
Avatar of Barry01

ASKER

How to use it and then copy the result to the bitmapinfoheader
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.
Avatar of Barry01

ASKER

actually the program is already written and I just want to add this function into it.
Avatar of Barry01

ASKER

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.
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
Avatar of Barry01

ASKER

can you give me the outline of function to perform this I will try to implement it.
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.