|
Hi, all
i tested creating userControl at runtime using Activator.CreateInstance method.
in testing, I found some different thing about Load Event.
when i designed userControl without ActiveX Control (ex, WebBrowser control), Load Event occurred when it is added to other parent control.(ex : panel.Controls(userControl1))
but, when it is designed with ActiveX Control,
Load Event occurred at CreateInstance method.
I must handle Load event, but it's invoked time is different.
why Load Event Invocation Time is different?
thanks for regards!!
|
|
|
|
|
i am using the axWebbrowser in my app, and was wondering how i might jump to a location within the same page. basically, i'm trying to simulate having an that jumps to a location referenced by elsewhere in the same page. what i have done is inserted the tags into the doc's innerHtml, and later when i try to call navigate(), i dont't know what url to pass it. if it was an external page on disk, i'd just pass it "<location>/page.html#jumptohere" as the url, but since i'm working with the DOM, i dont know what to use as the url to postpend my jump locatino to.
i'm sure there's other ways, too, like jumping to an element using the dom or somethign, but i haven't found it. thanks.
|
|
|
|
|
you should be able to use simply #jumptohere as the url.
Using the DOM it would be
document.location.hash="#jumptohere"
|
|
|
|
|
sir,
i am an student of computers and i want to know about project on c language plzz help me for making the project i cannot able to choose what project i made can you help me for making that project
thanks
pranshu
|
|
|
|
|
This forum is for the C# language, not the C language - two entirely different languages built against two entirely different platforms (managed vs. unmanaged).
Try the Visual C++ forum.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
First of all welcome to CP, since you just joined, but this is the C# forum and not a C forum. You will get better responses in the right forum.
This question has been posted to many email groups and on many forums and there is no right answer. It all depends on what you want to focus on. You could focus on UI, database, algorithms, multimedia, etc. It all really depends on what you are used to and are familiar with.
Are you doing windows programming, console apps, drivers, services? Are you using MS C# or Mono? You need to help us out to get to know you too. for school projects there has to be some sort of guidelines as to what is needed. One of the first steps in being a developer is to understand your requirements. When I let my students start projects without alot of detail it was to teach them that they can ask their customer (the instructor) for more information before starting the application.
This reminds me of an interview question that I have heard of. You are told to go to the whiteboard and design a house. If you go directly to the board and draw a house you would never be hiredbecause the house was for giraffes and your design did not take that into consideration. Or the house had to withstand cold temperatures of the North Pole, but you only put an air conditioner in because you live in a warm climate and nobody has heat.
One suggestion I have to to make a small program that would help you to do something that you enjoy (like a hobby). This could be to calculate the time that you had to take in coming to the surface when deep sea diving. Or to be more geek-like, a small program that let you keep track of your high scores on every video gamethat you play. The possibilities are endless.
Steve Maier, MCSD MCAD
|
|
|
|
|
Do you mean C, or C++ ? As has been pointed out, it doesn't seem like you mean C#.
It really depends on your skill level. If you're starting, try writing some small things like calculators and so on. If you're beyond that, think of something you have a use for ( that will keep your motivation up to finish the thing ). For example, I've written several different database applications over the years to keep track of aspects of my music collection.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Hi all,
i am having 12 bit image data in a 2D array. How can i create a 48 bpp bitmap image using actually 12 bits only for pixel color information and the remaining 4 bits to be padded. Should i have to define any color pallete for it in the header? or can i directly enter the pixel values for each Red,Green and Blue by copying the lower byte value in the first byte and the MSB value in the second byte?..IF not...how can i create a Palette. How can i store the pixel color values for each pixel (R,G,B).
At present I am using the following command to create a 48 bpp bitmap
Bitmap b = new Bitmap(Width,Height,PixelFormat.Format48bppRgb);
how can i access the Bitmap byte by byte right from the beginning (not from the data [using Scan0]).. I mean the header.
any ideas or suggestions r appreciated...
thanks in advance,
Suman
|
|
|
|
|
why not use the Scan0? I dont think there's a better way to access the actual memory. If you dont want to lock the bitmap, you can use the Bitmap.SetPixel member function.
there are no facts, only interpretations
|
|
|
|
|
P/Invoke the native GDI APIs you need and use the HBITMAP handle form Bitmap.GetHbitmap . That handle is also the address of the entire block of memory, but to use it you'll need to pin the Bitmap into memory so the GC doesn't move it. See the GCHandle class for more information about locking the Bitmap (which can also get you the HBITMAP you can use).
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
The fact that you're putting 16 bits in to specify each colour means that, by default, there is no palette information required.
Why do you need to access the header ?
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
HI Graus,
thanks graus... it seems u r very nice... i thought th u would be vexed by my frequent questions.
Actually wht happened is my advisor asked me to convert those LL1/LT1 format image files to BMP format and he hasn't specified the bit depth ahead..so, i thought of doin the most common 24bit BMP image. But yesyerday, he want me to use all the 12 bits in my original image to create a 48 bit BMP image (16/16/16) by using 12 bits for actual pixel information and padding the reaminin as it was int he original image.
So, now I want to convert the original image into 48 bit bmp instead of 24 bit, which i did now. But, i am thinkin tht it is not the same way as i implement 24 bit for implementing 48 bit. I thought should I have to use any color pallete to do so...
if i am worng, please let me guide into right direction. If u think there is some easy way to do this.. plz lemme know..as soon as possible...
thanks in advance,
Suman
|
|
|
|
|
Suman Somanchi wrote:
I thought should I have to use any color pallete to do so...
Definately not the case. The way a pallete works is that it stores all the colours, then the rest of the image is pallete indexes. It's done to save room, and therefore not done on images with more than 256 colours.
Did you tell your supervisor that Windows cannot display images with more than 24 bits ? You can set it up to be 32 bit, but the extra byte is ignored, it's the same colour count as 24 bit. Also, given that your image is grey scale ( isn't it ), if that is true, then you only have 256 shades of gray to choose from.
Unless you're sending your images to a very funky printer or other device that can handle the bit depth, your supervisor is ignorant. Either way, the most significant bits remain, the difference is going to be very slight.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Hi Graus,
yeah we have discussed on the display issues, but wht he is concerned abt is if we convert it into a 48bit Bitmap then we can reatain the original pixel data and it willbe helpful for some image processing techniques, sothat we can reduce data losses.
I am clear, wht we have thought. Anyway I successfully converted it into 48bit bitmap and displaying its histogram.
thanks for ur advices all the way,
Suman
|
|
|
|
|
Hi Graus,
I am able to produce a 48 bit bitmap... but it seems there are no white greylevels at all in it, it is showing full of greylevels and black...
How can we invert a 48 bit bitmap....do we have to do any shifting operations or can we proced using substraction doe for 24 bit bitmap.
if u have any ideas plz lemme know...
thanks in advance,
Suman
|
|
|
|
|
White is when all the bits are turned on. If you don't have any whites, your algorithm is obviously wrong, or the source image has no whites.
How are you displaying a 48 bit image ?
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
I am using a 48bit bitmap handle all the time when i am cerating and manupulating with 48bit bitmap. Coming to displaying the image.. i am sure tht the display shows only 256 greaylevels.. but i can see the difference between the two images, one converted into 24 bit (8/8/8) and the other one 48bit (16/16/16).. becos i think it is due to clipping...in 24 bit we are forcing 12 bit information into 8 bit where we would loose some greylevel info.. but in 48 bit we are not lossin it and the display maps itself to 256 greylevels.
Now I hope, 'm getting all greylevels.
Is wht I am thinkin is right?
thanks and lookin forward to discuss with you on more issues,
Suman
|
|
|
|
|
If what you get is different between the two, your algorithm is wrong. You still can only display 256 grey levels, less than you are trying to put into both images. Therefore, if there's a visible difference, you're doing it wrong.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Hmm... but i don't know how to tell tht the image i am displaying is right or wrong.
here is wht exactly wht i am displaying. I am displaying a radiograph of spinal cord. When i am viewing it in a 24bit format, I can barely see 3-4 vertebrae outlines, but when i display it in 48bit, then there is improvement, now i can see around 4-6 vertebrae outlines, without loss of any of the previous information ( i mean the information which we can see in a 24bit).
Anyway.. how can i crosscheck my code whether wht it is doin is right or wrong..?
Suman
|
|
|
|
|
Suman Somanchi wrote:
Anyway.. how can i crosscheck my code whether wht it is doin is right or wrong..?
Compare it to the original image ?
By the way, you need to be doing some pretty funky image processing to care about those extra four bits. Create a Bitmap object, draw on it in black, and then draw some shapes using the grey level of 1. In other words, the colour is 1, 1, 1. Can you see the shapes you've drawn ? That colour difference is greater than the most significant piece of information you're retaining by going to 48 bit.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
yeah we have to compare with the original image.. but i am not able to display the originalimage as it is in raw format and is of some extension (*.LL1/*.LT1), for which as far as my search, didn't find an editor to display them.
Yep u ar right, we can't view the difference between them and i too agree with it. But, I can't do anything since, I am a student and I have to do what my advisor says.. I am doin this to satisfy him.
But in my opinion... 24 bit images are well suited for humans to perceive the difeerence between all the greylevels and also to display the images.
Suman
|
|
|
|
|
Suman Somanchi wrote:
But in my opinion... 24 bit images are well suited for humans to perceive the difeerence between all the greylevels and also to display the images.
Yeah, well, 256 colour paletised images are equally good, being identical.
Suman Somanchi wrote:
but i am not able to display the originalimage
If your advisor expects you to be able to display an image that you can't even see to compare to, they should be pleased with whatever they get. If you can't see the problem in the code, tell them that you've done it, the 48 bpp looks better, which proves them right, then sit back and suck up the praise. If they're going to ask you to do it a dumb way and not give you the resources you need, then that's as much as they deserve. It sounds like the 48 bit image is the one that you're doing right anyhow, which makes sense as you're starting with 48 bits, it's obviously the conversion to 24 bits that you've screwed up.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Hi Graus,
If u don't mind. I am having another question. How can we draw a 3D surface plot in a c++ program. I am having the three (x,y,z) data generated in my program, but i don't know how to create a plot of them at runtime. I hope we have to create an activeX control to implement tht. But my program is a plain cpp program. At present i am writing all the data into a text file and opening it in an excel sheet seperately and then drawing the graph.
if we have to convert, how can we convert a plain cpp file to activeX and include tht functionality.
if u r familiar with this and r having some ideas, plz share with me...
thanks,
Suman
|
|
|
|
|
Suman Somanchi wrote:
how can we convert a plain cpp file to activeX and include tht functionality.
You want to turn your app into an ACtive X control, or you want it to consume an existing ActiveX control ? How will ActiveX plot 3D for you ? DirectX will, and the DirectX sdk has heaps of examples for you. I don't think you need direct X though, you need to do some reading on 3D math and then you can plot it yourself.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Thanks Graus,
I will try to implement what u told and infact i am little bit aware of tht 2D to 3D geometry in my Computer Graphics course in my undergrad. For today I am stopping my programming, since I want to spend sometime on other subjects too. I will do it tommorow and let u know the improvements...
Suman
|
|
|
|
|