|
There are several solutions. Using raw C++, you could open the file in binary mode, seek the end of the file pointer, and append data.
Kuphryn
|
|
|
|
|
|
Can anyone direct me to a source that explains ways to code 'zoom ins and outs'? What I basically need is an algorithm to blow up or shrink down an image by clicking a button or, better, by rubberbanding an area of the image.
Thanks,
Ralf.
ralf.riedel@usm.edu
|
|
|
|
|
Just type cximage in search box it will take you to the project which does all this and more
|
|
|
|
|
StretchBlt is all you need.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Christian Graus wrote:
StretchBlt is all you need.
But it's non-intelligent in its operation as it doesn't resample the image but merely cuts pixels off or blows pixels up. CxImage[^] gets my vote.
--
Dad, how strange it is that the pig can speak. *thoughtful pause* It must have lost its "oink". (my 3-year old daughter Moa, while watching Babe)
Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so. (Douglas Adams)
|
|
|
|
|
Johann Gerell wrote:
But it's non-intelligent in its operation
True, but we're assuming that this guy needs the complexity that comes from adding another class to his project ( not saying that CxImage is hard to use, I've not looked at it ). If you set the right stretch mode, StretchBlt gives reasonable results, why uses a jack hammer to nail in a tack ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Christian Graus wrote:
If you set the right stretch mode, StretchBlt gives reasonable results
Well, I develop for CE, where the stretch mode can't be set (it's carved in stone).
Christian Graus wrote:
why uses a jack hammer to nail in a tack
That's often the normal scenario when dealing with CE's limited API set.
Anyway, the resampling code can easily be broken out from CxImage and be used separately.
--
Dad, how strange it is that the pig can speak. *thoughtful pause* It must have lost its "oink". (my 3-year old daughter Moa, while watching Babe)
Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so. (Douglas Adams)
|
|
|
|
|
Johann Gerell wrote:
Well, I develop for CE, where the stretch mode can't be set (it's carved in stone).
That's a whole different ball game then
Johann Gerell wrote:
That's often the normal scenario when dealing with CE's limited API set.
*grin* well, no-one had mentioned CE before this, so...
Johann Gerell wrote:
Anyway, the resampling code can easily be broken out from CxImage and be used separately.
Sure - that stuff is pretty easy to write in any case.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Thanks for all that discussion. I'll try both, one for a quick and dirty image processing and the other for situations when a more accurate processing is justified. Best,
Ralf.
ralf.riedel@usm.edu
|
|
|
|
|
Christian Graus wrote:
*grin* well, no-one had mentioned CE before this, so...
No, but you asked for a scenario when the big hammer must be used, so...
--
Dad, how strange it is that the pig can speak. *thoughtful pause* It must have lost its "oink". (my 3-year old daughter Moa, while watching Babe)
Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so. (Douglas Adams)
|
|
|
|
|
Hello All,
Can someone suggest a fast ways to convert big endian to small endina? Thanks!
Nachi
|
|
|
|
|
there is a bswap ASM instruction, however, this might not be the fastest way on all architectures.
DWORD SwapEnidan(DWORD x)
{
__asm mov eax, x
__asm bswap eax
__asm mov x, eax
return x;
}
Another option (that could be better if you have to convert many values and unroll the loop by two) would be splitting into bytes and shifting around:
DWORD x = ...;
DWORD swapped = ((x & 0x000000FF) << 24) |
((x & 0x0000FF00) << 8) |
((x & 0x00FF0000) >> 8) |
((x & 0xFF000000) >> 24));
I don't think that XCHG or "manually" swapping bytes is faster.
we are here to help each other get through this thing, whatever it is Vonnegut jr.
sighist || Agile Programming | doxygen
|
|
|
|
|
I have a SDI application with a tab view. I make a call to a function that I call GetGrandParent().
The call and function is shown below.
//function is called here...
// parent is Tab Control, grandparent is Tab View
//m_pTabViewWnd = (CTabVw *)GetGrandParent();<---problem here???
//////////////////////////////////////////////
//function
CWnd* CSmsPropPage::GetGrandParent()
{
CWnd *parent= GetParent(); // tab control is the parent
return parent->GetParent(); // tab view is the grandparent
}
In debug the pointer returned is fine, the application runs...but in release mode, the pointer is invalid.
As a matter of fact a call to GetGrandParent() in Release mode causes the debugger to step into a function called:
CWnd * PASCAL CWnd::FromHandler(HWnd hWnd). The program doesnt actually step in GetGrandParent() in Release Mode.
I have the compiler set up so that I can debug in Release Mode.
Does anyone have any idea why the pointer is invalid in Release Mode, and why FromHandler() is called?
Thanks.
Jerry
|
|
|
|
|
What is CSmsPropPage? Is that a separate dialog window? Post the code that creates it.
Kuphryn
|
|
|
|
|
Im building a C++ DLL for visual basic
i cant get this to work, why ?
yes i now im not good with C++
I now i can call SendMessage with visual basic ( thats easy )
I need to go around a bug, This message just wont work
with visual basic
i did find webpage's with this problem
(HWND_BROADCAST ,WM_SETTINGCHANGE,SPI_SETNONCLIENTMETRICS,NULL);
How can i pass the variables to SendMessage ?
#include <windows.h>
long __stdcall main (int hWnd, int Msg, int wParam, int lParam)
{
::SendMessage(hWnd, Msg, wParam, lParam);
return 0;
}
plz help,
Greets jeroen
|
|
|
|
|
soul_ripper wrote:
How can i pass the variables to SendMessage ?
I don't understand the question !!
pass them as you do with any other function
more explanation/code will help us understanding your problem.
|
|
|
|
|
soul_ripper wrote:
Im building a C++ DLL for visual basic
Do you mean a C++ DLL that will be used by VB? If you mean something different, please explain so that we do not provide you with unnecessary suggestions.
soul_ripper wrote:
I need to go around a bug, This message just wont work
with visual basic
Which message is problematic?
soul_ripper wrote:
long __stdcall main (int hWnd, int Msg, int wParam, int lParam)
{
::SendMessage(hWnd, Msg, wParam, lParam);
return 0;
}
The parameters passed to main() are int , char ** , and char ** .
That aside, the first parameter to SendMessage() must be a valid window handle, or HWND_BROADCAST if you want all top-level windows to receive the message, that has a message pump.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
[Code]
Do you mean a C++ DLL that will be used by VB?
[/code]
yes the DLL will be used by Visual basic
[code]
Which message is problematic?
[/code]
this message is not working
SendMessage(HWND_BROADCAST ,WM_SETTINGCHANGE,SPI_SETNONCLIENTMETRICS,NULL)
Declared with visual basic
[code]
Declare Function SendMessage Lib "USER32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal Msg As Long, wParam As Any, lParam As Any) As Long
[/code]
Call the message with visual basic
[code]
Public Sub test()
Call SendMessage(HWND_BROADCAST, WM_SETTINGCHANGE, SPI_SETNONCLIENTMETRICS, Null)
End Sub
[/code]
I need a dll that replaces the user32.dll SendMessage function
like this sample
passing value’s
[code]
Declare Function SendMessage Lib "send" Alias "SendMessageA" (ByVal hwnd As Long, ByVal Msg As Long, wParam As Any, lParam As Any) As Long
[/code]
[code]
long __stdcall main (value 1, value2, value3, value4 )
{
::SendMessage(value 1, value2, value3, value4);
return 0;
}
/*
[/code]
How can I pass the value’s from visual basic in to the Sendmessage function from
The C++ DLL ?
|
|
|
|
|
soul_ripper wrote:
this message is not working
Define "not working."
soul_ripper wrote:
Call SendMessage(HWND_BROADCAST, WM_SETTINGCHANGE, SPI_SETNONCLIENTMETRICS, Null)
You're sending a message that sets the metrics associated with the nonclient area of nonminimized windows, yet those metrics are never supplied. Does that not raise any flags?
You need to declare a NONCLIENTMETRICS structure, fill in the relevant members, and pass that in as the fourth parameter.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Like this sampel ?
[code]
//// Simple Sub Call
void __declspec(dllexport) TestSubb
(int Message1, char Message2, char Message3, char Message4)
{
Message1, // handle of destination window
Message2, // message to send
Message3, // first message parameter
Message4; // second message parameter
::SendMessage (Message1, Message2, Message3, Message4);
return;
}
[/code]
i have this error :
[code]
C2664: 'SendMessageA' : cannot convert parameter 1 from 'int' to 'struct HWND__ *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
[/code]
Why ?
Jeroen
|
|
|
|
|
soul_ripper wrote:
::SendMessage (Message1, Message2, Message3, Message4);
You are callng SendMessage() wrong. Read here.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I posted a question the other day about using MFC's CListCtrl as a base. Someone told me to draw the control dynamically on my empty control and then relay the function calls to the CListCtrl object. This was a great idea, and exactly what I needed. But I don't know where to put the code to create the listview at. If I put the creation code in My Control's constructor, it compiles fine, but never actually draws it. I put the same code to create it in a dialog-based app and it draws just fine. I even tried a couple of other places in my Control's code, but it crashes on me when I try to actually use it (in VB). Can anyone tell me what's the problem? Thanks in advance
bdiamond
|
|
|
|
|
Do you handle WM_PAINT messages? Check if you should forward the message to CListCtrl.
...Plug & Pray...
|
|
|
|
|
thanks
If it's broken, I probably did it
bdiamond
|
|
|
|
|