I am using blogger with a custom domain name. whenever I post an image, the URL of that image is under blogspot.com. How can I change that to mydomain.com?
To just move the images off blogspot.com:
(NB you need to choose the picture-load icon from the Compose window, not the Edit HTML window - the latter does not have the URl-upload option.)
Whether or not it's possible to move them to mydomain.com depends on how you got mydomain.com, and whether your package with the registrar include file hosting? If so, you should just upload the pictures to that storage space using whatever tools they provide, and then use the URL as I outlined before. However if your package doesn't include file hosting (including if you purchased mydomain.com via Blogger) then it's probably not possible (unless you transfer the domain to another domain registrar that does offer image file hosting)
And I have to wonder - why do you want images to be on mydomain.com Is there some underlying goal you're trying to achieve here? Share it, and someone may be able to suggest better alternatives.
If you want your images to be under mydomain.com, you need to get web hosting to host those images. Google will never place images in the blog under mydomain.com.
Once you have got web hosting, upload your files to the host and use the "From a URL" function when inserting an image. This would directly hot-link the images from mydomain.com.