graphics - AggPas Delphi Drawing Transparencies -


What is trying to do

I have a drawing process (It works) it pulls a bitmap for "OBJemap" then puts Objemp in the entire map. All this works but there is a problem. It seems that behaving as undefined parts of objmap in white form though objmap and wholemap are set as PF32bit, and so when I put objmap in full size, I paste it Behind the image, there is a white box which should be transparent.

It is only on ATI machines, but it is for schools and they have 100% AT because they are cheap (honest not honest), so I used Agg. Recommended to do

My code

  Process Dresse (); Var Objelment, Line Lang, Philippine, OBJ, Lin, Angle, I, X1, Y1, X2, Y2: Integer; Npoints: array [0..1] of Tpoint; WG, OZ: Tag 2D; Objmap, wholemap: TBitmap; Start // Set WholeMap bitmap wholemap: = Tbitmap.Create; Fullmap.PixelFormat: = pf32bit; Wholemap.Transparent: false =; Wholemap.Width: = field; Wholemap.height: = field; WG: = Tagg2d.create; Bitmap Preview (fullmetap, 0); WG.attach (fullmap, false); WG.ClearAll (255,0,0,255); // Bitmapelpha Transpensii (Wholemap, 255); //WG.MasterAlpha(255); // Draw the object OBJmap ObjLength through each object: = length (objects); For Obj: = 0 (ObjLength-1) if objects are [Obj]. Then start // set up object map bitmap Objmap: = Tbitmap.Create; Objmap.PixelFormat: = pf32bit; Objmap.Transparent: True =; Objmap.Width: = objects [obj]. Boundright objects [obj]. Boundleft + 3; Objmap.height: = objects [obj]. BoundTop objects [obj]. Boundbottom + 3; OG: = Tagg2d.create; OG.attach (Objmap, false); {OG.ClearAll (0,0,255,255); // Transparent Oz. Clears all the bitmaps in MesterAlpha (255); OG.LineWidth (5); Og.AntiAliasGamma (255); Ozzy OG.LineColor (0255,0,255); OG.FillColor (0255,0,255); // oz. OG.MoveTo (0,0); OG.LineTo (Objmap.width -1, Objmap.height-1); } // Draw line objectivity line line: = length (objects [obje]. Lines -1); Angle: = objects [Obj] .Rotation; For lin: starting from = 0 (lineline) // i: = 0 to 1 point transform points [m]: = point accession (rotate point (ogg). Lin [lin]. Oxide [i] , Angle), point (-objects [obj] .leftleft, -Objects [obj]. Boundbottom), false); // Attract Drawing points Objmap: DrawLine (Npoints [0] .x, Npoints [0]., Npoints [1] .x, answer [1] .O, Objects [OBG]. Lin [Lin]. , Objmap, OG); End; // Fill the fill Objmap Filllength: = Length (Objects [Obj]. Fills) -1; Start the filtration with I: = 0 / Transport Points Npient [0]: = Point Execution (Rotate Point (Objects) [OBJ] Fillals [I]. Oxide [Obj] .Rotation), point (-Advertisement [OBJ] .leftleft, -Objects [obj]. Boundbottom), false); // Fill Point Objmap: = Integer (Npoints [0] .x, NPint [0] .O, Objects [Obj]. [I] .. Color, Objmap); End; // Full stamp x1: Draw ozmep for objects [obg]. Position.x + Objects [OBG]. Bound -1; Y1: = area- (objects [obj] .Position.y + objects [obj] .boundtop) -2; X2: = x 1 + Objmap.Width; Y2: = y1 + Objmap.Height; WG.TransformImage (Objmap, x1, y1, x2, y2); // this show limit // wg Police force (objemap, x1, 1); // It draws the scene, but transparency is not handled correctly. // fullmap.Canvas.Draw (x1, y1, objamap); / / / Pf32bit on ATI machines / wg.Free; // do not like it (accident) i need it? Objmap.Free; End; // Write the entire map in Visible canvas main window.bufrm.convas.DRA (0,0, FullMap); Wholemap.Free; Mainwindow.RobotArea.Picture.Graphic: = mainwindow.bufferim.Picture.Graphic; End;  

Image example

is not working, working and, currently honorable

alt text

I am only able to get work results by default on Nvidia machines

  wholemap.Canvas.Draw  

method and I use it to aggpass all the machines I want to work on

What will I do if I draw objmap on the whole map, but do not pull the transparent bits?

I had only one problem, you must set Blend Mode before calling conversion image

  WG.BlendMode (AGG_BlendSrcTop);  

This works for me but you may have to try several mixing modes before getting the correct answer.


Comments