|
You need to read it manually ? If you just read it in, the byte array won't read in with YCbCr values ?
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Well, even if I read it in manually, it's compressed. That's the trick: how do I handle jpeg compression? Jpegs aren't stored in a simple pixel-by-pixel format. Or... so I gather.
|
|
|
|
|
C# can read a number of formats, including jpeg, and give you a byte array. Read my image processing articles for more info.
So, if the jpeg just contains YCbCr instead of RGB, it would be a simple case of reading the file, iterating over it, and converting each pixel to an RGB value.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
I think that there's something broken in the image I was testing with. I have a single-page TIFF which I can extract a YCbCr encoded jpeg from and open with a .Net bitmap. Thanks for the help!
|
|
|
|
|
Hi All,
I added a C# class file to the C# project.
I want to use the drop down control at runtime. I get an error when I write
using System.Web.UI.WebControls;
on top of the page. Can't we not use it?? How do I access any control at runtime in a class. Please let me know.
Thanks.
|
|
|
|
|
You're probably trying to use web controls in a project that has not imported the dll that contains them
But that's a wild guess, seeing as you've not told us the error.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Thanks. The error is
The type or namespace name 'UI' does not exist in the class or namespace 'System.Web' (are you missing an assembly reference?)
|
|
|
|
|
Yep - I'm right then. I'm not sure if you can use the web controls outside an ASP.NET project. They work by generating HTML in conjuction with the ASP.NET ISAPI filter, you realise that, right ? What's wrong with the Windows controls ?
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Thanks. Ok, now I just converted a code from VB.net class file to a C# class file. This works fine in VB.net. But it gave error here.
|
|
|
|
|
OK, in that case your converter sucks. Just add the reference ( there's a references section on the top of the project, just right click and choose add reference, and look for System.Web, or whatever it is you need ) and you should be fine.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Thanks a lot.
I have added the statment:
using System.Web.UI.WebControls;
I no longet get the error. But when I write using System. I don't see "Web" in the intellisense. Why?? ANy idea.
|
|
|
|
|
Intellisense is unreliable at the best of times - don't worry about it.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Cool!
I have another Q, how do I create an ascx file for a user control.
When I click on "Add user control", I get a xyz.cs file and not ascx file.
This is the last Q...
|
|
|
|
|
There are two types of controls, one that has an ascx, and one that is code only. Make sure you're creating a 'web user control'.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
How do I add the ascx file? If I add the Usercontrol file, I get .cs extension file. I then change the extension to .ascx but I can't view the code. What am i doing wrong.
This is really bugging.
|
|
|
|
|
Changing the extension would be a dumb thing to do. For starters, you need a .cs file in a user control as well.
Like I said, if I right click on the project and choose 'Add Web User Control', I get an ascx. It's a custom control that doesn't have an ascx file. There is something very screwy about your setup, or how you're going about this.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
You probably have a Windows Forms project when you want an ASP.NET project. Can you verify that?
How to know: select the project name in the Solution Explorer. The property window should have only two items, project file and project folder. Project folder should be disabled. If project folder is a normal path, it's a Windows Forms project. If it is a URL (http://localhost....) it's an ASP.NET project.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
Where would I place a .config file for a windows serice? Would it only be used when I install the service or would it be used everytime the service was started?
Cheers,
Jim
|
|
|
|
|
The .config is always opened when the corresponding executable tries to access it and will have to be positioned at the same location as the executable.
(I assume you mean the "myProgramName.exe.config" file)
|
|
|
|
|
Yes, that's exactly what I meant. I just don't know where exactly the executable sits when its a service. I suppose it doesn't actually go anywhere and calls the same one anyways? Should I just install the service as per usual?
Cheers,
Jim
|
|
|
|
|
When you install your app as a service the current executable path is used, and the same executable path is used every time the service is started.
mav
|
|
|
|
|
Oh Really? That would mean that i only have to recompile a file after I have installed it, as opposed to uninstalling and reinstalling the file every time.
Thanks,
Jim
|
|
|
|
|
I have a question that I'm sure some of the experts here will be able to answer.
I have a custom business object that, by itself, contains a small amount of data. However, during runtime, that object may create and hold more data depending on how it is used. Basically, I want the object to grow-on-the-fly rather than allocate everything all at once.
The way I've set this up is through a property in the object:
public BigStuff[] HugeData
{
get
{
if (this.hugeData == null)
{
this.hugeData = new HugeData();
}
return this.hugeData;
}
}
This way, hugeData is only allocated when it is needed.
Now to the problem: multithreading. This property has the potential to allocate hugeData multiple times if the get_HugeData method is called asynchronously from multiple threads. What is the best way to get around this? Currently, I've placed a [MethodImpl(MethodImplOptions.Synchronized)] tag on the getter of the property, but I don't know how efficient that is, or whether there's a better way to do this. Any thoughts?
Tech, life, family, faith: Give me a visit.
Judah Himango
|
|
|
|
|
Internally this attribute uses the lock(this) construct which is in my opinion rather bad practice. I always prefer locking against a private member variable. If you do so you also have more control over what is locked against what (sound strage heh? )
Efficiency is the same with both solutions and I dont think this should be a problem (unless you are going to call this hundreds of times per second).
|
|
|
|
|
Whoa - so it actually locks the entire object? Are you sure? How, then, would that attribute work on static classes? Sheesh that's scary, I didn't know it locked the entire object. Yeah, maybe I'll lock my private hugeData then, unless locking isn't allowed on a null variable.
Tech, life, family, faith: Give me a visit.
Judah Himango
|
|
|
|