Transparenz in Borland C++ Builder 5
-
Hey,
da die suchfunktion ja leider nicht funktioniert versuch ichs mal so, ich hoffe ihr könnt mir da helfen:Also folgendes:
Ich kann bei einer normalen Bitmap im Objekt inspektor von Borland einstellen, das mein bild transparent dargestellt wird, was laut hilfe heisst, dass der hintergrund ausgeblendet wird.
Ich habe den hintergrund des bildes blau gemacht, um es dem Programm leicht zu machen aber wie ihr sehen könnt funtzt es noch nicht ganz,http://bhb.cybton.com/kugel.JPG
Weis irgend jemand wie ich des richtig hinbekomm, dass alles drum herum weg is?
Wär super,
danke schon mal im vorrausMfG BHB
-
Kann man bei diesem Bild schlecht sagen, aber vielleicht ist an den Rändern der Kugel das Blau durch Antialiasing verfälscht ...
Anyway, mit echter Transparenz zu arbeiten ist sowieso schöner als Colorkeying.
-
du kannst deiner form auch gleich exakte maße geben ,somit wird das was du transparent darstellen möchtest garnicht erst angezeigt...
-
@ ink3n
wie meinst du das? Klar ich kann die höhe und die breite Festlegen, aber da ich das ja als Bitmap einfüge hab ich ja die ecken die nicht von der kugel ausgefüllt werden. Mir wär bis jetzt nich bekannt wie ich ein rundes Bild sonst einfügen kann
-
Ich würde auch mal sagen, das da gar kein Blau ist.
Bye, TGGC (Keine Macht den Dummen)
-
HRGN EHandle=CreateRectRgn(x1,y1,x2,y2); HDC hdc=GetDC(Form1->Handle); SetWindowRgn(Form1->Handle,EHandle,true); ReleaseDC(Form1->Handle,hdc);//x1-y2 bezeichnen die koordinaten in pixeln gesehen auf die bilschirmauflösung
//CreateRectRgn(x1,y1,x2,y2) is ne api funktion und da gibts noch andere formen
//SetWindowRgn(Form1->Handle,EHandle,true); damit wird die "region" gesetzt-------------------
->CreateEllipticRgn (X1,Y1,X2,Y2)
->CreatePolygonRgn (lpPoint,nCount,nPolyFillMode)
· lppt
Points to an array of POINT structures that define the vertices of the polygon. The polygon is presumed closed. Each vertex can be specified only once.· cPoints
Specifies the number of points in the array.· fnPolyFillMode
Specifies the fill mode used to determine which pixels are in the region. This parameter can be one of the following values:
ALTERNATE
Selects alternate mode (fills area between odd-numbered and even-numbered polygon sides on each scan line).
WINDING
Selects winding mode (fills any region with a nonzero winding value)->CreatePolyPolygonRgn (lpPoint ,lpPolyCounts, nCount, nPolyFillMode)
· lppt
Points to an array of POINT structures that define the vertices of the polygons. The polygons are specified consecutively. Each polygon is presumed closed and each vertex is specified only once.· lpPolyCounts
Points to an array of integers, each of which specifies the number of points in one of the polygons in the array pointed to by lppt.· nCount
Specifies the total number of integers in the array pointed to by lpPolyCounts.· fnPolyFillMode
Specifies the fill mode used to determine which pixels are in the region. This parameter can be one of the following values:
ALTERNATE
Selects alternate mode (fills area between odd-numbered and even-numbered polygon sides on each scan line).
WINDING
Selects winding mode (fills any region with a nonzero winding value).soa das sind einige... mach was draus ^^ die höhe und breite deiner form , die du eingestellt hast sind dabei egal! undagen wird das ganze unter formcreate eingetr