How i can convert from png or other to ddj ? because i make image in photo shop and cant save .ddj .. if i pui name.ddj and put in media.pk2 ,,, media dont read it and cant open client... any idea?
static public byte[] DDJ_to_DDS(byte[] ddjStream)
{
byte[] ddsStream = new byte[ddjStream.Length - 20];
Array.Copy(ddjStream, 20, ddsStream, 0, ddsStream.Length);
return ddsStream;
}
static public byte[] DDS_to_DDJ(byte[] ddsStream)
{
byte[] ddjStream = new byte[ddsStream.Length + 20];
Int32 ddjStreamLen = ddsStream.Length + 8;
byte[] header1 = {0x4A, 0x4D, 0x58, 0x56, 0x44, 0x44, 0x4A, 0x20, 0x31, 0x30, 0x30, 0x30};
byte[] header2 = BitConverter.GetBytes(ddjStreamLen);
byte[] header3 = {0x03, 0x00, 0x00, 0x00};
Array.Copy(header1, 0, ddjStream, 0, header1.Length);
Array.Copy(header2, 0, ddjStream, header1.Length, header2.Length);
Array.Copy(header3, 0, ddjStream, header1.Length + header2.Length, header3.Length);
Array.Copy(ddsStream, 0, ddjStream, header1.Length + header2.Length + header3.Length, ddsStream.Length);
return ddjStream;
}
i have convertor to dds . but .. i cant open dds with photoshop ... and i want to convert jpg or png or to save directly dds or ddj ..Quote:
DDJ can be easily converted to DDS which can be opened in various image editors.
c# snippet:
Code:static public byte[] DDJ_to_DDS(byte[] ddjStream) { byte[] ddsStream = new byte[ddjStream.Length - 20]; Array.Copy(ddjStream, 20, ddsStream, 0, ddsStream.Length); return ddsStream; } static public byte[] DDS_to_DDJ(byte[] ddsStream) { byte[] ddjStream = new byte[ddsStream.Length + 20]; Int32 ddjStreamLen = ddsStream.Length + 8; byte[] header1 = {0x4A, 0x4D, 0x58, 0x56, 0x44, 0x44, 0x4A, 0x20, 0x31, 0x30, 0x30, 0x30}; byte[] header2 = BitConverter.GetBytes(ddjStreamLen); byte[] header3 = {0x03, 0x00, 0x00, 0x00}; Array.Copy(header1, 0, ddjStream, 0, header1.Length); Array.Copy(header2, 0, ddjStream, header1.Length, header2.Length); Array.Copy(header3, 0, ddjStream, header1.Length + header2.Length, header3.Length); Array.Copy(ddsStream, 0, ddjStream, header1.Length + header2.Length + header3.Length, ddsStream.Length); return ddjStream; }
FINALY THANKS SO MUCH :XQuote:
You need the .dds plugin for photoshop to be able to edit them.
[Only registered and activated users can see links. Click Here To Register...]