|
Can someone suggest a simple way to shrink/ stretch a BMP? Better not involving MFC. Thanks.
|
|
|
|
|
try that function.....CDC::StretchBlt
|
|
|
|
|
I knew that...;P
Maybe need to talk in more detail...
Some function would provide the BITMAPINFOHEADER and Bitmap buffer data. I wanna change the size of the resulting BMP. The step I thought was that:
1. call CreateCompatibleDC( ) to create a memory DC.
2. call CreateCompatibleBitmap( ), get the handle of a bitmap and use last-created memory DC to select it.
3. call memcpy( ) to copy the data to the last-created compatible bitmap.
4. call StretchBlt( ) from the memory DC to the dialog DC( or memory DC number 2 ).
For I need to save time, the data of the BMP after stretch need to be saved. So...the following work may required to be done only once.
5. call GetCurrentBitmap for the dialog DC( or memory DC number 2 ).
6. call CBitmap::GetBitmapBits( ), get the data( upset-down, need to flip. )
7. CreateDIBSection( ) for the new data in new size.
8. OK, next time when repaint is required, simply use a memory DC to select these bitmap handles and call BitBlt from a memory DC to dialog DC.
( The steps concerning with the deleting of some temp GDI objects are omitted. )
OMG! Too many steps... Is there a simpler way than that? Thanks!
|
|
|
|
|
|
Hi...
How i can access Windows NT bu knowing the username and password via VC++. I am trtying to pass parameters vis URL but there is pop window asking for password and username first so i need to pass this point then send the URL.
|
|
|
|
|
IIRC You can pass the username and password within the URL.
e.g. http://username:password@site.com
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
i tried what you told me but i am geting error page " page cannot be open"...any other suggestions?
|
|
|
|
|
Um, perhaps this only works when the site supports Basic Authentication. I am not sure what you could do to get around this.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
My application (under VC++ .net) should communicate with external hardware, with a protocol that requires the carriage return sent as a control character.
However, when I add the "\r" to the string, e.g.
string s1="\r00220101\r";
my program seem to go nuts.
I use a simple console program for test purposes,and when I try to print the string with "cout", the string doesn´t print at all and the order of the other "cout´s" seem totally random. There are no similar problems with "\n" or "\t".
Does anybody have a suggestion
regards
doneirik
|
|
|
|
|
Hi,
I too dont have any correct idea, but you can try doing one thing.
try clearing the output stream, perhaps using something equivalent to
fflush(stdin) or a flushall before cout ing anything.
Hope that helps.
Bye.
AslFunky
|
|
|
|
|
solved it. (more or less)
|
|
|
|
|
Please share so that others may benefit.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Actually I don´t know exactly what was the cause...
1. I tried to send the characters using a string or character array. Forgot that en extra "\0" is added. This might have caused some problems.
2.The number of bytes to write parameter in the writefile function: I passed it as an int, then as a short. Had problems with int not with short.
Still I don´t understand why or if this really caused the problems, and why it was only with the "\r"..
doneirik
|
|
|
|
|
Hello all,
I am writing a DLL that wraps another DLL in an interface that can be called from VB.
the dll ahs a callback function defined as
typedef int(_cdecl *cbfuncText)(int HisNodeID, char *str, void *arg);
In my wrapper DLL i have a function that translates this into a new Callbac function
that is defined as
typedef int(__stdcall *cbWfuncText)(int HisNodeID, char* str, void *arg);
When i use the C string directly as shown here VB gets an empty string.
when i try to use a BSTR instead, the VB program crashes.
The VB function i use in the 2 situations are
Function TextCB(ByVal HisNodeID As Long, ByVal str As String, ByRef arg As Long) As Long
and
Function TextCB(ByVal HisNodeID As Long, ByRef str As String, ByRef arg As Long) As Long
Can anybody tell me what i am doing wrong?
and/or give me suggestions of how to solve this?
In Advance thanks
Michael
|
|
|
|
|
When am building my application using DirectX(DirectShow) components,
am getting the following Linker errors:
Linking...
error LNK2001: unresolved external symbol _IID_IMediaEvent
error LNK2001: unresolved external symbol _IID_IMediaControl
error LNK2001: unresolved external symbol _CLSID_FilterGraph
error LNK2001: unresolved external symbol _IID_IGraphBuilder
Debug/trial_DShow.exe : fatal error LNK1120: 4 unresolved externals
Can anyone help in what scenario does the above errors pitch in.??
Thanks, Pramod.
|
|
|
|
|
Hi,
You have to link the needed libs. Think that you have to add strmiids.lib explicity in the linker options
Hope that this will help you
Sujan
|
|
|
|
|
Usually, the link error 2001 means that you didn't link libraries required. The help file of the directshow has a page "Setting Up the Build Environment". Read this page and you'll find these libraries required:
Strmiids.lib
Quartz.lib ( not required if you don't call AMGetErrorText(), can be omitted in your case. )
If you don't know how to link these libraries, a simple way is provided in the following:
1. Click the Menu:
(In Visual C++ 6.0)
Tools -> Options -> Directories, and then choose item of the combobox below the text "Show Directories for" Library Files and set the path of these 2 libraries.
(In Visual Studio .Net)
Tools -> Options -> Projects -> VC++ Directories , and then choose item of the combobox below the text "Show Directories for" Library Files and set the path of these 2 libraries.
2. Add the following codes to where you want to include some files(Ex: You can add them in stdafx.h):
#include "Dshow.h"<br />
#pragma comment ( lib, "Strmiids" )<br />
#pragma comment ( lib, "Quartz" )
good luck!
|
|
|
|
|
Hello developers.
I want ask you if anybody konws how can I create a application which will transfer bits (bytes)
throught a USB port - i mean input/output something like it was in old DOS enviroments using inportp/outportb.
This is why I need to communicate with an own unknown device attached to USB and know that a driver must be created but I don't realy want to use the DDK. Is there a other way to create this
driver?
Apropo: can I get a link to a full example or source code to a USB driver tutorial it will be very helpful
|
|
|
|
|
|
|
Hi ,
I want to Mix audio file and Video File into one file may be AVI ,
using DirectX , ( is it with Direct Show but how ? )
How can i do that ,
Any hint , or idea . Link
thanx
Regards
|
|
|
|
|
|
What I need to do is write a DLL that will play an audio signal. The problem is, the source of the audio will not be any kind of music/audio file or even some recording stored in a wav class of some sort. What I am working with is the raw data, an array representing the entire signal.
For those of you familiar with MATLAB, you know MATLAB has a function called "wavplay".
Let's say I have a 1x200000 array called "audioSignal". If I know that this signal was originally sampled at 50kHz (that is, the samples are spaced apart by increments of 20 microseconds) then all I have to do to play the signal stored in the array is enter the following command:
>> wavplay(audioSignal, 50000);
Of course, if I use, say 30000 instead of 50000 this just deepens the pitch and lengthens the duration of the signal, but doesn't actually change it.
This is exactly the kind of method I want to be able to use in my C++ DLL, but I have no idea how to write a method that does this myself. Does anyone know of any built-in methods that I don't know about, or does anyone know where I can find code that will do this? Any help is good help, God bless.
|
|
|
|
|
Hi
I am working in vc++. I have a library(dll) and a Test application(.exe) which uses this .lib file. I have a function(Thread function) in the dll which has to insert data into a circular linked list . This linked list should be accessible in the test application, and the test application should simultaneously be able to take the inserted data in the dll from the linked list and display in list ctrl.
The linked list should be used as a global interface between the test application and the library. As such, both modules should have a pointer to this linked list.
How can I do this? Can anyone please guide me? I never worked with this kind of application.
Thanks in anticipation of information.
Madhavi.
|
|
|
|
|
Hi,
You can use "Memory Map Files" - Share Memory
Look out for API "CreateFileMapping","MapViewOfFile","OpenFileMapping" etc.
It might will help you !
Regards,
Vishal
|
|
|
|