In form i have different object (like picturebox),i want to acces these object from another class for example class1
signimage
Posts
-
How to access from objects from other class -
UNhandled Exception of Type System.NullReferenceExceptionColin Angus Mackay wrote:
That is because it is obviously not instantiated properly
how to instantiat object properly?
-
UNhandled Exception of Type System.NullReferenceExceptionis there any way to access the from object from another class,usually i create the obj of form then using that obj we access the obj from form then why it give me the null reference erroe, and im sur that obj has obj referenc but it cannot send this reference to other class,(why)
-
UNhandled Exception of Type System.NullReferenceExceptioni face the same problem when ever i try to acces any object of form from any other calss (within same project) how to acces the form object (like picture) from any other calss i use the form obj to acces the formobjfrom other class but it give reference inmstance error
-
UNhandled Exception of Type System.NullReferenceExceptionPictureBox take its image from file and i m sure that pictureBox has its image,this is not empty pictureBox but still it give thte above mentioned error
-
UNhandled Exception of Type System.NullReferenceExceptionIn my project two forms(form1 and form2) when from form1 i try to Access any object of from2 then it give me error that object reference not set to an instance of object, me using following way in form1 i create the obg of from2 as from2 f=new fomr2(); Bitmap b=(Bitmap)f.pictureBox1.Image; if(b.GetPixel(100,100)==-1) {//code} it give the abovemention error in if statement when i try to accec the pixels of that object. What should i do?????????
-
Convert RectanglrF To Bitmap and put this in to pictureBoxIS there is aNY Simple way through which we can convert RectangleF to Bitmap?
-
How Matlab funtin work in C#I am working in Image Processing Project,I want to bring imcrop funtion of matlab in my C# Project ,I do not how i will do this Plz help me and guide me It is very urgent Thanks in Advance
-
working with 2D Arrayint[] W=new int[10]; int[][] wind=new int[2][]; Color c1 = h.GetPixel(1,1); W[0]=c1.ToArgb(); wind[0][0]=W[0]; this code give me run time error at wind[0][0]=W[0]; I do not know why,is there any error,can some one guide me,
-
How work with images in C# [modified]plz help in converting code from matlab to C#, i m sending u code as i told im working in image processing , ihave done all work in matlab but now i hve convert it in to C# Code is below %Reading image file and storing it in a variable. imagex=imread('D:\MS_courses\ece655\Project\test_images\test_image3.jpg'); %RGB2GRAY converts RGB images to grayscale by eliminating the %hue and saturation information while retaining the luminance. %im2double takes an image as input, and returns an image of class double. f = im2double(rgb2gray(imagex)); %f=[.1,.2,.3;.4,.5,.6;.7,.8,.9]; %Storing the number of rows and columns in separate output variables [sizeM, sizeN] = size(f); %Counter is used just to check the status of the program at all times. counter = 0; %for k=1:1:256 %gvalue_f(k) = 0; %gvalue_N(k) = 0; %end %-------------------------------------------------------------------------- %This loops makes a window of 3*3 and scans over the image from left to %right and top to bottom to get those pixel values that are most probably %a function of Impulse, called Nimp. for x=2:1:(sizeM-1) for y=2:1:(sizeN-1) k = x; l = y; x1 = f(k-1, l-1); x2 = f(k-1, l); x3 = f(k-1, l+1); x4 = f(k, l-1); x5 = f(k, l); x6 = f(k, l+1); x7 = f(k+1, l-1); x8 = f(k+1, l); x9 = f(k+1, l+1); W = [x1,x2,x3,x4,x5,x6,x7,x8,x9]; x_sum = 0; count = 0; x_temp = 0; wind(1,1) = W(1); wind(1,2) = W(2); wind(1,3) = W(3); wind(2,1) = W(4); wind(2,2) = W(5); wind(2,3) = W(6); wind(3,1) = W(7); wind(3,2) = W(8); wind(3,3) = W(9); for m=1:1:3 for n=1:1:3 x_temp = wind(m,n); if((x_temp == min(W)) | (x_temp == max(W)))% | (x_temp <= 10) | (x_temp >= 230)) Nimp_sub(m, n) = x_temp; else count = count + 1; x_sum = x_sum + x_temp; Nimp_sub(m, n) = 0; end end end %Nimp=size(f); Nimp(k-1:k+1,l-1:l+1) = Nimp_sub; counter = counter + 1 end end %--------------------------------------------------------------------------- %for k=2:1:sizeM-1 % for k=2:1:sizeN-1 % gvalue_f(f(k, l)) = gvalue_f(f(k, l)) + 1; % Nimp_db = im2uint8(Nimp(k, l)) + 1; % gvalue_N(Nimp_db(k, l)
-
Matlab to C# conversioni am sending matlab code,can some one help me to convert this code into C#, imagex=imread('D:\MS_courses\ece655\Project\test_images\test_image3.jpg'); %RGB2GRAY converts RGB images to grayscale by eliminating the %hue and saturation information while retaining the luminance. %im2double takes an image as input, and returns an image of class double. f = im2double(rgb2gray(imagex)); %f=[.1,.2,.3;.4,.5,.6;.7,.8,.9]; %Storing the number of rows and columns in separate output variables [sizeM, sizeN] = size(f); %Counter is used just to check the status of the program at all times. counter = 0; %for k=1:1:256 %gvalue_f(k) = 0; %gvalue_N(k) = 0; %end %-------------------------------------------------------------------------- %This loops makes a window of 3*3 and scans over the image from left to %right and top to bottom to get those pixel values that are most probably %a function of Impulse, called Nimp. for x=2:1:(sizeM-1) for y=2:1:(sizeN-1) k = x; l = y; x1 = f(k-1, l-1); x2 = f(k-1, l); x3 = f(k-1, l+1); x4 = f(k, l-1); x5 = f(k, l); x6 = f(k, l+1); x7 = f(k+1, l-1); x8 = f(k+1, l); x9 = f(k+1, l+1); W = [x1,x2,x3,x4,x5,x6,x7,x8,x9]; x_sum = 0; count = 0; x_temp = 0; wind(1,1) = W(1); wind(1,2) = W(2); wind(1,3) = W(3); wind(2,1) = W(4); wind(2,2) = W(5); wind(2,3) = W(6); wind(3,1) = W(7); wind(3,2) = W(8); wind(3,3) = W(9); for m=1:1:3 for n=1:1:3 x_temp = wind(m,n); if((x_temp == min(W)) | (x_temp == max(W)))% | (x_temp <= 10) | (x_temp >= 230)) Nimp_sub(m, n) = x_temp; else count = count + 1; x_sum = x_sum + x_temp; Nimp_sub(m, n) = 0; end end end %Nimp=size(f); Nimp(k-1:k+1,l-1:l+1) = Nimp_sub; counter = counter + 1 end end %for k=2:1:sizeM-1 % for k=2:1:sizeN-1 % gvalue_f(f(k, l)) = gvalue_f(f(k, l)) + 1; % Nimp_db = im2uint8(Nimp(k, l)) + 1; % gvalue_N(Nimp_db(k, l)) = gvalue_N(Nimp_db(k, l)) + 1; %end %end %Calculating the histograms of input image and Nimp (those pixels in the image %which are most probably members of impulse noise). temp_hist_f = hist(f, 256); temp_hist_imp = hist(N
-
Matlab to C#I m working in image processing in C#,actually i have done all work in matlab but now now i have convert it in to C#, Can someone help me,major problem that i m facing is woking with 2d arrays
-
converting Matlab code ito C#Thanks for replying,Actually i am trying yo convert matlab code into C#,if u can help me then i will send u the code in matlab and also that work that i have done C#, but plz help me and give me ur mailing id so that i could send u code in attachments
-
How work with images in C# [modified]Hello iam of student of BS compSc ,im working on my final project that is"Histogram-Based Fuzzy Filter" trying to implement research paper, but i m facing alot of problem do not know how to encode in C#, i have done some work on image like conversion of rgb image into grayscale ,and also draw its histogram but no succes towards implementing this papper, i have to complete this project in a 15 days plz help me -- modified at 1:50 Tuesday 29th August, 2006