473,473 Members | 2,008 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

how to convert an image into a matrix or more?

6 New Member
1-i want a code in c# which can analyze an image and converts it into a matrix or more.

2-when i enter the resulting matrix in the program ,it coverts the matrix into an image again.

please help me and thanks
Mar 24 '10 #1
8 7399
GaryTexmo
1,501 Recognized Expert Top Contributor
What do you mean by "matrix"? My understanding of a matrix is just a 2D array, which is pretty much what an image is by default. If you want the actual data, you can take a look at the Bitmap class on MSDN, specifically the GetPixel and SetPixel methods. If you're in XNA and you're using a Texture2D object, I know you can get the data as an array of Color objects.

Anything else and you'll have to do some digging I'm afraid. Usually the MSDN documentation is sufficient to show you how to access the data the the image is comprised of.
Mar 24 '10 #2
wessam3011
6 New Member
thank u for replying on me

the point is that ,i want to encrypt the image with specific algorithm so i want a code to transform the image into matrices so i can add the encryption key to the image's matrices to encrypt it and i want the inverse of this operation to transform the matrices into an image again.

thanks.
Mar 24 '10 #3
wessam3011
6 New Member
i did this operation long time ago but by matlab,now i need it by c# and do not know how to make it
Mar 24 '10 #4
wessam3011
6 New Member
matrix here = array this is wt i mean
Mar 24 '10 #5
GaryTexmo
1,501 Recognized Expert Top Contributor
Yea ok, so see my first post. If you load the image into a Bitmap object, you should be able to directly access it's image data. From there, you can do a couple of things...

1) Modify the image data, write it back to the image, and save it. The image will be loadable as a normal bitmap but will look like nonsense.

2) Write the encrypted image data to a file. When you read that file back in, you decrypt it and set the image data on a new bitmap to restore the image.

3) Some other method you've thought of :D
Mar 24 '10 #6
wessam3011
6 New Member
3) Some other method you've thought of :D
--------------------------------------------------------------
thx for replying and no i do not have a one

put pls can u give me the code?
Mar 25 '10 #7
GaryTexmo
1,501 Recognized Expert Top Contributor
The code is for you to write, not me. I've shown you where the tools are, there's lots of information available to you, and I'm quite happy to help you work through any issues you have when coding, but you're the one who has to write it.

Roll up your sleeves and get cracking. If you have any troubles, post the problem and the code related to it.
Mar 25 '10 #8
wessam3011
6 New Member
thank u for helping me

and

finally i started to write the code
it is easier to make it instead of searching for it
:)
Mar 28 '10 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Daniel | last post by:
I have looked everywhere on the web for an answer to this and the only thing I can find is converting the image format when the file is present on the local filesystem. What I want to do is use a...
5
by: Trammel | last post by:
Hi, I have a vb.net program made to grab screenshots and then store them in image objects. The image is displayed in a pictureBox atm but I want to store the data in a String only. (Without...
5
by: Socrates | last post by:
I am interested in developing an online utility that will enable users to copy and past any image (or upload any image on the internet) to the online utility, which will then convert the image to...
5
by: aks1232001 | last post by:
Hello Everyone, I'm new to this place. Have a few doubts hoping to get some response soon :) 1. How can i convert a color BMP file into a monochrome black and white image (NOT GRAYSCALE) in C...
8
by: piggy | last post by:
I am trying to convert an image to an byte array (tobytes() method) and from byte array back to an image (frombytes() method). The problem i have here is say the image size is 285 bytes but the...
1
by: fluffybunny87 | last post by:
I need to convert an image from RGB format to LMS format using matrix's and an array of double to hold the LMS values as they're created. I need to take each pixel (R, G, and B) and and multiply it...
1
by: gnkt4ujt2002 | last post by:
how to convert image into hex format in vs.net 2003 ....bcoz i hav 2 send image on mobile using sms tgate way.. i hav a clickatell sms gate way...
3
by: surajhs | last post by:
hi, I am working on java applet, i created a interface to view image in panel on jlist selected image item which is in local machine path, Now i need to convert image to xml and along with i...
1
by: surajhs | last post by:
i need to convert image to binary data and create xml file in applet, Please send samples links
0
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.