pbsds Posted January 18, 2010 Share Posted January 18, 2010 This is something I can't figure out, I have an array width the RGBA value of each pixel in a photo. But when the image is saved it shows up non-transparent! But nothing else is corrupted... this is the code im using: Func PixelArrayToImage($Array,$Width,$Height,$out) _GDIPlus_StartUp() $Bitmap = _WinAPI_CreateBitmap($Width, $Height,1,32) $image = _GDIPlus_BitmapCreateFromHBITMAP($Bitmap) _WinAPI_DeleteObject($Bitmap) For $y = 0 to $Height-1 step 1 For $x = 0 To $Width-1 step 1 $temp = Hex($Array[$x+$y*$Width]) DllCall($ghGDIPDll, "int", "GdipBitmapSetPixel", "hwnd", $image, "int", $x, "int", $y, "dword", Dec(StringRight($temp,2)&StringLeft($temp,6))) Next Next $Format = _GDIPlus_EncodersGetCLSID(StringUpper(FileType($out))) _GDIPlus_ImageSaveToFileEx($image, $out, $Format) _GDIPlus_ImageDispose($image) _GDIPlus_ShutDown() EndFunc Func FileType($file) $name = StringSplit($file, ".") return $name[UBound($name)-1] EndFunc Thanks. Fuck 'em if they can't take a joke. Link to comment Share on other sites More sharing options...
pbsds Posted January 18, 2010 Author Share Posted January 18, 2010 Anyone? Fuck 'em if they can't take a joke. Link to comment Share on other sites More sharing options...
pbsds Posted January 19, 2010 Author Share Posted January 19, 2010 COMMON! I CAN't WAIT ANYMORE! > Fuck 'em if they can't take a joke. Link to comment Share on other sites More sharing options...
jvanegmond Posted January 19, 2010 Share Posted January 19, 2010 COMMON! I CAN't WAIT ANYMORE! >Nice. Now I am sure I will not take a look at the code. github.com/jvanegmond Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now