One by one loop through the frames, then dump back bytes to the file. of the wanted transparent color, then enter the index in the specific field (which is a Byte) accordingly. (2) Find out from the global or the local pallete entries (within the boundary of the No of global or the No of local entries as the case may be) what is the index No. (1) Change the frame's "use transparent color" flag to "Yes". If "Yes", nothing further to be done for this frame. Establish whether this frame is coded to "use transparent color". of local palette entries (will be of use). Establish whether a specific frame uses global palette, if it says "No", Local Pallete exists, obtain the No. of global palette entries (will be of use) Ascertain whether Global Palette exists The answer is "Yes" on the premise that one is familiar with the GIF file structure, as the job will entail, e.g. If hImg 0 Then Call GdipDisposeImage(hImg)Ĭan we make the background of an animated gif transparent ?Ĭan we do that in VB without the use of an intermediary transparent container or third party libraries? Ret = GdipSaveImageToFile(hImg, StrConv(inFileSpec, vbUnicode), uCLSID, uEncParams) Ret = GdipSetImagePalette(hImg, VarPtr(mPalette)) If inTranspColor >= 0 And inTranspColor 0 Then GoTo earlyExit 'Since inDIB is created bottom up, vertically adjust inDIB Ret = GdipCreateBitmapFromHBITMAP(inDIB.DIBhDIB, 0, hImg) Optional inTranspColor As Long = -1) As Booleanĭim uEncParams As EncoderParameters 'Memo: We have pre-dimensioned its Parameter as "(1)" for convenience Public Function SaveDIB_via_GDI_BPP8(inDIB As clsDIB, ByVal inFileSpec As String, ByVal inEncoder As GpImageFormat, _
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |