Friday, April 13, 2012

events will occur when a page is loaded

1 PreInitialize
2. Initialize
3. Initialize Complete
4. PreLoad
5. Load
6. LoadComplete
6. PreRender
7 PreRenderComplete
8 Unload

Work and the reward will be nothing

Work and the reward will be nothing

now time is 12:17 Am . i worked more than 3 hours on a small code that have issue in the domain, i don't know is the problem in the domain is that it is not live so the stmp server refuse my request to use the server !!!!. may be

i tried to debug my code with no result so its time to give up and give my mind a little time to reclaim himself

working at this time is become usefulness because I'm disappointed and tired

i will back again with a fresh mind and i hope i can find a solution

bye now.


GetThumbnailImage During Work

to solve the issue with my code first i generated the following function

public static byte[] GetImagesInBytes(string id){
 // some code here


this function convert the image in the database to a bytes array then i created the following function

 public static System.Drawing.Image BytesToImage(byte[] ByteArrayIn)
{
 //some code here
}

this function get the desired image from the byte array, but one thing make me worried System.Drawing.Image is that a valid for web controls?? will see i hope yes and i think yes it will work
and we will see :D

yes it worked fine
  i'm happy for that.



GetThumbnailImage

This is a new function to me.
this function made me change the code design in my site and i spent much time to get my code fixed.

the problem with this function to me is that it accept only its input parameters from three places
1- from a file which is an image in your site directory (not option for me)
2- from Hbitmap : i'm really what that mean but i think it some kind of getting the image from canvas and creates it in a private directory and then we go to the first kind this accepts and sooooooo (not option to me)
3- from stream : here i can deal with this function to get my desire output but the problem is the image in a remote server, so i have to connect to the server and create the image in a stream of betes and pass them to the function

all this done in hard coded way but i have to do this because i have to know that before design my code

at end... for any developer..... search again and a gain before you start to code.

thanks
Ahmed Lotfy