|
Hi!!
I must admit your site has been very usfull to me :p
any way I have been looking throught the MFC GDI+ articles you have, and throught them I have manged to convert a 24bit Colour bmp to a greyscale 24bit bmp.
I was wondering if there is a way to convert the bmp to a 2bit dithered bmp?
I have looked about but not found anything that I can undestand(and mainly all .NET code )
I have seen the Bitmap::ConvertFormat and the Image.SetPalette but these require a ColorPalette structure and I cant seem to find a useful article on how to create one.
any help is appriciated :->
Junior Programmer (Newbie)
From Scotland
|
|
|
|
|
Hello
You can look at my image processing library [^]. There are several dithering methods implemented. The library is on C#, but it's not hard to understand these algorithms.
You can also look at CxImage[^], which is written on C++.
Andrew
|
|
|
|
|
Thanks I'll look into those!!
Junior Programmer (Newbie)
From Scotland
|
|
|
|
|
write a c++ prog thathandles 3 types of objects.
-trucks
-cars with engine cappacity greater than 1200cc
-cars with engine cappacity less than 1200cc
the annual road tax for a truck is $3000,those with engine cappacity gretaer than 1200cc is $300 and that with less than 1200cc is $180
a text file holds the infomation on all vehicles within the company as shown
T w123mgb 5200 12(T stands for a truck object)
L k670kvc 2200 7(L stands for car with engine cappacitiy >1200cc
S y317jnb 1100 (S stands for a car with engine capacity <=1200cc)
the requirements of the program is to
a)read all records from the file and create an object for each type of vehicle
b)to provide a display method which given a registration number prints the details of that particular vehicle
c)as an additional measure, it should be able to calculate hte total ammount of road tax paid in a year.
develop a program to impleent this specification. the prog should use inheritance or polymorphism if appropriate. the number of records in the file should not exceed 100
|
|
|
|
|
START BY HELPING YOURSELF!!!!!!!
Ok. Now go and do your own homework. If you have specific questions, post them here.
By the way, a subject line describing your problem is preferred, rather than just shouting for help.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
good joke continue like this, i love your humour...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
go to rentacoder.com If you want someone to do your homework at least pay them.
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
I'll help you if you'll help me to retire by the time I finish your program..
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Hi
Im using SetCapture() to capture mouse events, so when the user clicks the program writtes something in that place.
Thats working great, but i would like to change the mouse cursor until user clicks.
I tried using SetCursor() but just works in my client area.
And WM_SETCURSOR is only sent to my window if the user has a button pressed.
Any sugestions?
Thanks in advance
|
|
|
|
|
Put a transparent window over the entire desktop and have it set the cursor. Once user clicks, translate it into the coordinate or whatever you want, and then hide the transparent window. I am pretty sure winow overrides the cursor shape for each window the mouse goes over, so you need to cover the entire portion of your 'working area' with a window that can 'force' the cursor to your desired shape.
OTHERWISE, take a look at some of the samples that use the 'window finder' tool, since they seem to be able to change the mouse cursor regardless of the window it is over. I am also pretty sure they rely upon the left mouse button being down for some reason - maybe merely to know when user has made a selection when the button is released, but since I never had occasion to use one of these, you will have to reasearch that part yourself.
|
|
|
|
|
Good idea, i gona try it
Thanks for the suggestion
|
|
|
|
|
Create a handler for WM_MOUSEMOVE , this gives you both local position and button states.
Elaine
The tigress is here
|
|
|
|
|
Thanks for the suggestion Elaine
But WM_MOUSEMOVE is sent to your application just if a button is pressed once the cursor leaves your client area.
That's why you have to drag the target cursor in programs like spy++
|
|
|
|
|
You will get events every time a new mouse position is regsitered by your application then reads the mouse button states and can detect a click that way.
You could also use OnClick and follow the last position given by your OnMouseMove handler.
The tigress is here
|
|
|
|
|
At last i found a solution...
I just simulate a drag operation, to do that, when the user clicks my button i simulate that the user press the right button using
mouse_event(MOUSEEVENTF_RIGHTDOWN,0,0,0, GetMessageExtraInfo());
Then when the cursor is outside my client area im still able to set the cursor shape.
Once the user clicks in the other window, i simulate that the user releases the right button using
mouse_event(MOUSEEVENTF_RIGHTUP,0,0,0, GetMessageExtraInfo());
And after that, i simulate the click the user has just done
mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0, GetMessageExtraInfo());
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0, GetMessageExtraInfo());
This work great for me, maybe if you have a Context menu, this isn't going to work, you could try using the middle button...
Ok, i wrotte this because i saw a lot of post similar to mine, and very few answers to this problem.
Thx to all for your suggestions
|
|
|
|
|
Hello,
i am developing inbound application using Tapi 2.0. now i want to
convert that application in Tapi 3.0. i don't know much about com.
any one know how to create inbound application using Tapi 3.0.
Any source code available. Plase send me source code for handling
incoming call.
please help me.
Best regards
Riya jain
dafdd
|
|
|
|
|
Hi Everyone,
I want to be able to read the Registry "ProxyEnable" located within HKEY_CURRENT_USER and located at the following path Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings. What I want to be able to do is tell whether "ProxyEnable" is on or off. Not quite sure how to do that particular piece though.
Thanks in advance,
Matt
|
|
|
|
|
|
The issue I seem to be having is that ProxyEnable is actually a Reg_DWORD key, so I don't think I'm reading it in correctly and I'm not sure how to verify that its actually an enabled key. Basically if I were to get a value back from doing a query on that key, what do I compare its value to?
|
|
|
|
|
Matthew Devine wrote:
Basically if I were to get a value back from doing a query on that key, what do I compare its value to?
As I understand it, 1 means enabled, 0 means disabled...
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Yeah that's exactly right, that's what I'm seeing
HKEY hKeyRoot,hKeyNew;
LPCTSTR lpSubKey;
LPTSTR Value;
DWORD retcode;
DWORD Value_type;
DWORD Value_data;
DWORD Value_size;
hKeyRoot = HKEY_CURRENT_USER;
lpSubKey = "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings";
Value = "ProxyEnable";
retcode = RegOpenKeyEx
(
hKeyRoot,
lpSubKey,
0,
KEY_QUERY_VALUE,
&hKeyNew
);
if (retcode != ERROR_SUCCESS)
MessageBox("Error opening key",_T("NO"));
retcode = RegQueryValueEx
(
hKeyNew, // HKEY (hkey) handle of key to query
Value, // LPSTR (lpValueName) address of name of value to query
NULL, // LPDWORD (lpReserved) reserved
&Value_type, // LPDWORD (lpType) address of buffer for value type
(BYTE *) &Value_data,// LPBYTE (lpData) address of data buffer
&Value_size // LPDWORD (lpcbData) address of data buffer size
);
if (retcode != ERROR_SUCCESS)
MessageBox("Error reading key",_T("NO"));
else
fout<<"Registry Value - "<
|
|
|
|
|
Matthew Devine wrote:
This seems to have solved the problem that I was having
Good!
Matthew Devine wrote:
Thanks again Jose, you have been a big help.
You're welcome. Glad to be of help.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Matthew Devine wrote:
...the reason the compare wasn't working was simply because I only had 1 "="'s after for Value_data
All the more reason to put the constant on the left side of the operator!
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
|
I'm using Excel Automation (#import method) to write data to an Excel file from my MFC application. The data export is working fine, with one exception.
The document for my app contains an enhanced metafile (as an array of bytes and a handle). I'd like to place this image in the Excel workbook I'm creating.
Can anyone help?
Thanks,
Greg Wellman
|
|
|
|