title: Save image from bitmap to jpeg without save the file
body: <p>I have a problem that I need to have a jpeg image with dpi 500 first it come from base64 I could converted it directly to jpeg but I don't know <strong>how to set the dpi to system.drawing.image</strong></p>
  
  <p>I have a solution is to get the image as bitmap then use the setresolution function to reset it to 500*500 and that what I need but to reconvert the bitmap again to jpeg it needs to be saved on physical drive and also I couldn't do that</p>
  
  <p>so I just need to get from image or bitmap to jpeg with 500*500 resloution actually I also will read it again to array of bytes but I need this array from a jpeg image with 500*500 dpi and the converted image from base64 is not 500*500 dpi</p>
  
  <p>any idea will be appreciated</p>