473,326 Members | 2,090 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Convert String to Imagename

gangste85™
Hello,

i am having a C# convert problem. I am using a XML to save positions of all the items on screen so you can customize.
I am having a image right now. Its Called Image1.
I have a string and a int.

If i use
Image1.Height = int;
the image will be change to the int value.
Now i have a string with the value Image1, if i use
string.Height = int;
I am getting the error that a string doesn't have a Height, thats normal,
But i need to know how to parse the string into the imagename, can anyone help, i have tried google, but most is garbage there...
Mar 13 '08 #1
3 1282
saran23
28
Hello,

i am having a C# convert problem. I am using a XML to save positions of all the items on screen so you can customize.
I am having a image right now. Its Called Image1.
I have a string and a int.

If i use
Image1.Height = int;
the image will be change to the int value.
Now i have a string with the value Image1, if i use
string.Height = int;
I am getting the error that a string doesn't have a Height, thats normal,
But i need to know how to parse the string into the imagename, can anyone help, i have tried google, but most is garbage there...
If Ur using the name of the image as string,it wont hav the height property,
try this create a image at run time, name it with the string value, and set the height.

If ur some more clear it will be easy to help u correctly.
Mar 13 '08 #2
I have declared a image.

<Grid>
<Image Height="60" Width="40" Margin="10,10,0,0" Name="image1" VerticalAlignment="Top" HorizontalAlignment="Left" Stretch="Fill" Source="/BackEnd_Demo_1;component/c_virginmary4.gif" Grid.Row="1" />
</Grid>

In a XML file i have two value's 20 and image1

I am getting thes value's and parsed 20 in to an int and image1 into a string
if i have the following code

image1.Height = int;

It change the height om image1, but i want to
use the string to say with image it is such as

string.Height = int;

but i nee to know how to parse a string to a ImageName..

am i clear...
Mar 13 '08 #3
saran23
28
I have declared a image.

<Grid>
<Image Height="60" Width="40" Margin="10,10,0,0" Name="image1" VerticalAlignment="Top" HorizontalAlignment="Left" Stretch="Fill" Source="/BackEnd_Demo_1;component/c_virginmary4.gif" Grid.Row="1" />
</Grid>

In a XML file i have two value's 20 and image1

I am getting thes value's and parsed 20 in to an int and image1 into a string
if i have the following code

image1.Height = int;

It change the height om image1, but i want to
use the string to say with image it is such as

string.Height = int;

but i nee to know how to parse a string to a ImageName..

am i clear...
Hi,
Im not sure how to implement this, but try this,
1.Create a image at run time,
2.set the string to the ID of the image,
3.now set the height property,

hope this works, ur image will have the name of the string value, and u can set the height too...
Mar 13 '08 #4

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

Similar topics

14
by: Gregory | last post by:
Hello, I'm trying to do the above in order to process an image and return the result to an html image control. It fails and my key suspects are either the variable that I'm passing in -...
4
by: Eric Lilja | last post by:
Hello, I've made a templated class Option (a child of the abstract base class OptionBase) that stores an option name (in the form someoption=) and the value belonging to that option. The value is...
4
by: aevans1108 | last post by:
expanding this message to microsoft.public.dotnet.xml Greetings Please direct me to the right group if this is an inappropriate place to post this question. Thanks. I want to format a...
3
by: Convert TextBox.Text to Int32 Problem | last post by:
Need a little help here. I saw some related posts, so here goes... I have some textboxes which are designed for the user to enter a integer value. In "old school C" we just used the atoi function...
7
by: patang | last post by:
I want to convert amount to words. Is there any funciton available? Example: $230.30 Two Hundred Thirty Dollars and 30/100
6
by: patang | last post by:
Could someone please tell me where am I supposed to put this code. Actually my project has two forms. I created a new module and have put the following code sent by someone. All the function...
4
by: tshad | last post by:
I am trying to convert a string character to an int where the string is all numbers. I tried: int test; string stemp = "5"; test = Convert.ToInt32(stemp); But test is equal to 53.
4
by: krishp | last post by:
Hi, I need to convert raw data recieved from a device through C#.Net socket to BMP format. For some reason the image conversion is not happening proparly and I can see only blur image . ...
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
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.