While (state = IMAPI_FORMAT2_DATA_MEDIA_STATE. IMAPI_FORMAT2_DATA_MEDIA_STATE.IMAPI_FORMAT2_DATA_MEDIA_STATE_UNKNOWN wait to flush all the content on the media If (_backgroundWorker.CancellationPending)
#IMAGE MASTERING API 2.0 UPDATE#
this is how it worked for my burner // speed = 0 => minimum speed descriptor in update // 0 half of minimum // speed descriptor in update // minimum speed descriptor minimum speed descriptor in update // next speed descriptor next speed descriptor in update I've packaged most of the burning capability in a helper class called BurnHelper, and below is its WriteStream method:Ĭopy Code public int WriteStream(.IStream stream,īool forceMediaToBeClosed, int speed, bool eject)ĭiscRecorder.InitializeDiscRecorder(initburner) ĭiscRecorder.AcquireExclusiveAccess( true, clientName) ĭiscFormat.ForceMediaToBeClosed = forceMediaToBeClosed ĭiscFormat.Update += DiscFormatData_Update Getting the stream interface is done using the ImageRepository.LoadCOMStream that was described in my previous article. The code for writing and formatting is similar to the code in Eric's article, with a few changes. Burning a File Optical Imageīurning an optical image boils down to writing a stream on your media.
This is the case when burning an existing ISO file image created with other tools overcomes this issue. While you might be able to play the latter on your computer and a few new players, most DVD players won't play it, because they expect a customized UDF format. In other words, if you have an ISO file containing a DVD movie, you will be able to burn it, but you can't create a proper DVD disk even if you copy all the files from the media. However, there is no problem in burning a file stream if the recorder supports the media type. If you are wondering why you would need to burn an ISO image when you could cold burn the files directly, then you should be aware that you cannot easily create every kind of format using IMAPI 2.0. I've made only minor changes to the code from my previous article, and I also got some cues from the sources I have mentioned below. I recommend you check the articles mentioned above should you need a better understanding of the inner workings or COM Interop issues. If you were interested only in burning folders and files on to media and skip the file image creation, you will be better served by Eric Haddan's great article. Using COM Interop to wrap the native components has some quirks I've tried to fix, but it is not very difficult, thanks to the samples from Microsoft. There might be other burning engines available, but I've chosen to use this API because it is likely to have long term support from Microsoft.
#IMAGE MASTERING API 2.0 INSTALL#
It is the same Image Mastering API v2.0 I'm using to achieve this goal, so you might want to install it before running this application.
#IMAGE MASTERING API 2.0 HOW TO#
If you've seen my previous article, How to Create Optical File Images using IMAPIv2.0, you might expect me to do something with that file image, like.