Sample Graphics: what changed
Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.
| Old | New | Line | |
|---|---|---|---|
| 1 | 1 | This gallery is to show the designs can be created from Lazarus and drawing tools, like BGRABitmap. | |
| 2 | 2 | ||
| 3 | 3 | Most examples are included in [[BGRABitmap]] & [[BGRAControls]] packages. | |
| 4 | 4 | ||
| 5 | 5 | You can grab more BGRABitmap demos here <https://github.com/bgrabitmap/bgracontest> | |
| 6 | 6 | ||
| 7 | 7 | ### Gradient Graphics | |
| 8 | 8 | ||
| 9 | 9 | **Description:** Shows how to create buttons and gradients with and without transparency in Lazarus using [[BGRABitmap]] and an enhanced version of [[Double Gradient]] that supports alpha. | |
| 10 | 10 | ||
| 11 | 11 | **Notes:** Tested on Win32. Tested on Linux with Kubuntu and Qt, work fine | |
| 12 | 12 | ||
| 13 | 13 | **Win32:** | |
| 14 | 14 | ||
| 15 | - | ||
| 16 | - | ||
| 17 | - | ||
| 18 | - | ||
| 15 | + |  | |
| 19 | 16 | ||
| 20 | 17 | **Kubuntu 10.04 with Qt:** | |
| 21 | 18 | ||
| 22 | - | ||
| 23 | - | ||
| 24 | - | ||
| 25 | - | ||
| 19 | + |  | |
| 26 | 20 | ||
| 27 | 21 | Top-Left: 'like flash player setup button' / Top-Right: 'like win7 explorer toolbar' / Bottom: double gradient with alpha / Background: same as bottom. | |
| 28 | 22 | ||
| 29 | 23 | #### Flash Player Button | |
| 30 | 24 | ||
| 31 | 25 | - Also you can use [[BGRAButton Gallery|Like Flash Player Setup Controls]] using [[BGRAControls]] to draw the button & related stuff. | |
| 32 | 26 | ||
| 33 | 27 | Add a new TPaintBox, set 'btn1' as name. Go OnPaint event and add this code: | |
| 34 | 28 | ||
| 35 | 29 | ``` pascal | |
| 36 | 30 | var | |
| 37 | 31 | tempbmp1, tempbmp2: TBGRABitmap; | |
| 38 | 32 | begin | |
| 39 | 33 | // Background Gradient | |
| 40 | 34 | tempbmp1:=TBGRABitmap.Create(btn1.Width,btn1.Height,BGRA(104,104,104,255)); | |
| 41 | 35 | tempbmp1.Canvas.GradientFill(Rect(1,Round(btn1.Height*0.25),btn1.Width-1,btn1.Height-1),$686868,$404040,gdVertical); | |
| 42 | 36 | ||
| 43 | 37 | // Frame Border | |
| 44 | 38 | tempbmp1.Canvas.Brush.Color:=$181818; | |
| 45 | 39 | tempbmp1.Canvas.FrameRect(btn1.ClientRect); | |
| 46 | 40 | ||
| 47 | 41 | // Light Gradient | |
| 48 | 42 | tempbmp2:=TBGRABitmap.Create(btn1.Width,btn1.Height,BGRA(0,0,0,0)); | |
| 49 | 43 | tempbmp2.GradientFill(1,1,btn1.Width-1,btn1.Height-1, | |
| 50 | 44 | BGRA(255,255,255,34), | |
| 51 | 45 | BGRA(255,255,255,10), gtLinear, | |
| 52 | 46 | PointF(btn1.ClientRect.Right,btn1.ClientRect.Top), | |
| 53 | 47 | PointF(btn1.ClientRect.Right,btn1.ClientRect.Bottom), | |
| 54 | 48 | dmDrawWithTransparency,True,False); | |
| 55 | 49 | tempbmp2.AlphaFillRect(2,2,btn1.Width-2,btn1.Height-2,0); | |
| 56 | 50 | ||
| 57 | 51 | // Merge Bitmaps | |
| 58 | 52 | //tempbmp1.Canvas.Draw(0,0,tempbmp2.Bitmap); | |
| 59 | 53 | tempbmp2.Draw(tempbmp1.Canvas,0,0,False); | |
| 60 | 54 | ||
| 61 | 55 | // Paint in Canvas | |
| 62 | 56 | //btn1.Canvas.Draw(0,0,tempbmp1.Bitmap); | |
| 63 | 57 | tempbmp1.Draw(btn1.Canvas,0,0,False); | |
| 64 | 58 | ||
| 65 | 59 | // Free Bitmaps | |
| 66 | 60 | tempbmp1.Free; | |
| 67 | 61 | tempbmp2.Free; | |
| 68 | 62 | end; | |
| 69 | 63 | ``` | |
| 70 | 64 | ||
| 71 | 65 | #### Windows 7 Explorer Toolbar | |
| 72 | 66 | ||
| 73 | 67 | - Also you can use [[BGRAButton Gallery|Like Windows 7 Explorer ToolBar Control]] using [[BGRAControls]] to draw the Button. | |
| 74 | 68 | ||
| 75 | - | ||
| 76 | - | ||
| 77 | - | ||
| 78 | - | ||
| 69 | + |  | |
| 79 | 70 | ||
| 80 | 71 | Add a new TToolBar with a TToolButton and set this properties: | |
| 81 | 72 | ||
| 82 | 73 | `AutoSize=True; ButtonHeight=48; EdgeBorders=[]; EdgeInner=esNone; EdgeOuter=esNone; ShowCaptions=True; Transparent=True;` | |
| 83 | 74 | ||
| 84 | 75 | Then go Form1 OnPaint event and add this code: | |
| 85 | 76 | ||
| 86 | 77 | ``` pascal | |
| 87 | 78 | procedure TForm1.FormPaint(Sender: TObject); | |
| 88 | 79 | var | |
| 89 | 80 | gradBmp: TBGRABitmap; | |
| 90 | 81 | begin | |
| 91 | 82 | with ToolBar1 do begin | |
| 92 | 83 | gradBmp := DoubleGradientAlphaFill(ClientRect,BGRA(245,250,255,255),BGRA(230,240,250,255), | |
| 93 | 84 | BGRA(220,230,244,255),BGRA(221,233,247,255),gdVertical,gdVertical,gdVertical,0.50); | |
| 94 | 85 | gradBmp.Rectangle(0,0,Width,Height-2,BGRA(255,255,255,100),dmDrawWithTransparency); | |
| 95 | 86 | gradBmp.SetHorizLine(0,Height-1,Width-1,BGRA(160,175,195,255)); | |
| 96 | 87 | gradBmp.SetHorizLine(0,Height-2,Width-1,BGRA(205,218,234,255)); | |
| 97 | 88 | end; | |
| 98 | 89 | gradBmp.Draw(Canvas,ToolBar1.ClientRect); | |
| 99 | 90 | gradBmp.Free; | |
| 100 | 91 | end; | |
| 101 | 92 | ``` | |
| 102 | 93 | ||
| 103 | 94 | #### Double Gradient with Alpha | |
| 104 | 95 | ||
| 105 | 96 | Add a new TPaintBox, set 'btn3' as name. Go OnPaint event and add this code: | |
| 106 | 97 | ||
| 107 | 98 | ``` pascal | |
| 108 | 99 | var | |
| 109 | 100 | myBitmap: TBGRABitmap; | |
| 110 | 101 | begin | |
| 111 | 102 | myBitmap:= DoubleGradientAlphaFill( | |
| 112 | 103 | btn3.ClientRect, | |
| 113 | 104 | BGRA(0,0,0,100),BGRA(255,255,255,100), | |
| 114 | 105 | BGRA(100,100,100,100),BGRA(150,150,150,100), | |
| 115 | 106 | gdVertical,gdVertical,gdVertical,0.5); | |
| 116 | 107 | //btn3.Canvas.Draw(0,0,myBitmap.Bitmap); | |
| 117 | 108 | myBitmap.Draw(btn3.Canvas,0,0,False); | |
| 118 | 109 | myBitmap.Free; | |
| 119 | 110 | end; | |
| 120 | 111 | ``` | |
| 121 | 112 | ||
| 122 | 113 | ### Progress Bars | |
| 123 | 114 | ||
| 124 | 115 | A progress bar is a component in a graphical user interface used to convey the progress of a task, such as a download or file transfer. | |
| 125 | 116 | ||
| 126 | 117 | #### Flash Player Progress Bar | |
| 127 | 118 | ||
| 128 | 119 | - Also you can use [[BGRAControls|BGRAFlashProgressBar]] control in [[BGRAControls]]. | |
| 129 | 120 | ||
| 130 | 121 |  'Like flash player setup progress bar'. Requires [[BGRABitmap]] and [[Double Gradient]] with Alpha. | |
| 131 | 122 | ||
| 132 | 123 | **Notes:** Tested on Win32, Kubuntu 10.04 with GTK and Qt. | |
| 133 | 124 | ||
| 134 | 125 | Add a new TPaintBox, set 'progressbar' as name. Go OnPaint event and add this code: | |
| 135 | 126 | ||
| 136 | 127 | ``` pascal | |
| 137 | 128 | var | |
| 138 | 129 | ABitmap, ABitmap2: TBGRABitmap; ARect: TRect; | |
| 139 | 130 | begin | |
| 140 | 131 | // Initialization | |
| 141 | 132 | // Self.Color:=$004D4D4D; | |
| 142 | 133 | ABitmap:=TBGRABitmap.Create(progressbar.Width,progressbar.Height); | |
| 143 | 134 | ARect:=progressbar.ClientRect; | |
| 144 | 135 | ||
| 145 | 136 | // Percent of Progress | |
| 146 | 137 | ARect.Right:=Round(ABitmap.Width*0.75); | |
| 147 | 138 | ||
| 148 | 139 | // Background Gradient | |
| 149 | 140 | ABitmap.Canvas.GradientFill(progressbar.ClientRect,$303030,$323232,gdVertical); | |
| 150 | 141 | ||
| 151 | 142 | // Background Border | |
| 152 | 143 | ABitmap.Rectangle(0,0,ABitmap.Width,ABitmap.Height,BGRA(28,28,28,255),dmSet); | |
| 153 | 144 | ||
| 154 | 145 | // Progress Gradient | |
| 155 | 146 | ABitmap2:=DoubleGradientAlphaFill( | |
| 156 | 147 | ARect, | |
| 157 | 148 | BGRA(102,163,226,255),BGRA(83,135,186,255), | |
| 158 | 149 | BGRA(75,121,175,255),BGRA(56,93,135,255), | |
| 159 | 150 | gdVertical,gdVertical,gdVertical,0.5); | |
| 160 | 151 | ||
| 161 | 152 | // Progress Border | |
| 162 | 153 | ABitmap2.Rectangle(0,0,ARect.Right,ARect.Bottom,BGRA(28,28,28,255),dmSet); | |
| 163 | 154 | ||
| 164 | 155 | // Progress Light | |
| 165 | 156 | ABitmap2.Rectangle(1,1,ARect.Right-1,ARect.Bottom-1,BGRA(153,212,255,100),dmDrawWithTransparency); | |
| 166 | 157 | ||
| 167 | 158 | // Merge Bitmaps | |
| 168 | 159 | //ABitmap.Canvas.Draw(0,0,ABitmap2.Bitmap); | |
| 169 | 160 | ABitmap2.Draw(ABitmap.Canvas,0,0,False); | |
| 170 | 161 | ||
| 171 | 162 | // Draw Bitmap | |
| 172 | 163 | //progressbar.Canvas.Draw(0,0,ABitmap.Bitmap); | |
| 173 | 164 | ABitmap.Draw(progressbar.Canvas,0,0,False); | |
| 174 | 165 | ||
| 175 | 166 | // Free Bitmap | |
| 176 | 167 | ABitmap.Free; | |
| 177 | 168 | ABitmap2.Free; | |
| 178 | 169 | end; | |
| 179 | 170 | ``` | |
| 180 | 171 | ||
| 181 | 172 | You can change the 'Percent' of progress changing this line: | |
| 182 | 173 | ||
| 183 | 174 | ``` pascal | |
| 184 | 175 | // Percent of Progress - 33% | |
| 185 | 176 | ARect.Right:=Round(ABitmap.Width*0.33); | |
| 186 | 177 | ||
| 187 | 178 | // Percent of Progress - 90% | |
| 188 | 179 | ARect.Right:=Round(ABitmap.Width*0.90); | |
| 189 | 180 | ``` | |
| 190 | 181 | ||
| 191 | 182 | ### About Dialogs | |
| 192 | 183 | ||
| 193 | 184 | "The Generic application includes an About dialog box. Every application should include an About dialog box. The dialog box displays such information as the application's name and copyright information." [Definition](http://msdn.microsoft.com/en-us/library/aa383735%28v=vs.85%29.aspx) | |
| 194 | 185 | ||
| 195 | 186 | #### Lazarus About | |
| 196 | 187 | ||
| 197 | 188 | Description: Lazarus-like about dialog. | |
| 198 | 189 | ||
| 199 | - | ||
| 200 | - | ||
| 201 | - | ||
| 202 | - | ||
| 190 | + |  | |
| 203 | 191 | ||
| 204 | 192 | Requires [[BGRABitmap]]. | |
| 205 | 193 | ||
| 206 | 194 | - **ToDO:** | |
| 207 | - | ||
| 208 | - | ||
| 195 | + | - Smooth text | |
| 196 | + | - Paw | |
| 209 | 197 | - Bitmap with leopard | |
| 210 | 198 | ||
| 211 | 199 | Add a new TPaintBox, and set Width = 450, set Height = 300, set Name = 'logo' | |
| 212 | 200 | ||
| 213 | 201 | (you can set another width and height, for example 900 x 600) | |
| 214 | 202 | ||
| 215 | 203 | Go to OnPaint event and add this code: | |
| 216 | 204 | ||
| 217 | 205 | ``` pascal | |
| 218 | 206 | ||
| 219 | 207 | uses BGRABitmap, BGRABitmapTypes, BGRAGradients; | |
| 220 | 208 | ||
| 221 | 209 | procedure TForm1.logoPaint(Sender: TObject); | |
| 222 | 210 | var | |
| 223 | 211 | bmp, bmp2, bmp3, bmp4, bmp5, bmp6: TBGRABitmap; | |
| 224 | 212 | rct: TRect; | |
| 225 | 213 | ||
| 226 | 214 | procedure DrawBackground; | |
| 227 | 215 | begin | |
| 228 | 216 | // Background | |
| 229 | 217 | bmp:= TBGRABitmap.Create(logo.Width,logo.Height,BGRAWhite); | |
| 230 | 218 | ||
| 231 | 219 | rct:= logo.ClientRect; | |
| 232 | 220 | rct.Left:= 1; | |
| 233 | 221 | rct.Top:= 1; | |
| 234 | 222 | rct.Right:= logo.Width-1; | |
| 235 | 223 | rct.Bottom:= Round(logo.Height*0.935); | |
| 236 | 224 | ||
| 237 | 225 | //radial | |
| 238 | 226 | bmp.GradientFill( rct.Left, rct.Top, rct.Right, rct.Bottom, | |
| 239 | 227 | BGRA(117,172,224,255), BGRA(49,74,132,255), gtRadial, | |
| 240 | 228 | PointF(Round(rct.Right*0.85), Round(rct.Bottom*0.50)), | |
| 241 | 229 | PointF(Round(rct.Left), Round(rct.Bottom)), dmSet ); | |
| 242 | 230 | end; | |
| 243 | 231 | ||
| 244 | 232 | procedure DrawEclipse; | |
| 245 | 233 | begin | |
| 246 | 234 | bmp2:= TBGRABitmap.Create(rct.Right,rct.Bottom); | |
| 247 | 235 | bmp2.FillEllipseAntialias( Round(rct.Right*0.57), Round(rct.Bottom*0.58), | |
| 248 | 236 | Round(rct.Right*0.31), Round(rct.Bottom*0.53), | |
| 249 | 237 | BGRA(255,255,255,30) ); | |
| 250 | 238 | bmp2.EraseEllipseAntialias( Round(rct.Right*0.585), Round(rct.Bottom*0.58), | |
| 251 | 239 | Round(rct.Right*0.31*0.88), Round(rct.Bottom*0.53*0.88), | |
| 252 | 240 | 255 ); | |
| 253 | 241 | end; | |
| 254 | 242 | ||
| 255 | 243 | procedure ThinCircleAndFrame; | |
| 256 | 244 | var mask: TBGRABitmap; | |
| 257 | 245 | begin | |
| 258 | 246 | bmp5:= TBGRABitmap.Create( rct.Right, rct.Bottom ); | |
| 259 | 247 | bmp5.GradientFill( 0, 0, bmp5.width, bmp5.Height, | |
| 260 | 248 | BGRA(117,172,224,255), BGRA(49,74,132,255), gtLinear, | |
| 261 | 249 | PointF(Round(rct.Right*0.5),Round(rct.Bottom*0.50)), | |
| 262 | 250 | PointF(Round(rct.Right),Round(rct.Bottom)), dmSet); | |
| 263 | 251 | mask:= TBGRABitmap.Create( rct.Right, rct.Bottom, BGRABlack ); | |
| 264 | 252 | mask.EllipseAntialias( Round(rct.Right*0.53), Round(rct.Bottom*0.50), | |
| 265 | 253 | Round(rct.Right*0.40), Round(rct.Bottom*0.65), | |
| 266 | 254 | BGRA(255,255,255,192), 0.6 ); | |
| 267 | 255 | bmp5.ApplyMask( mask ); | |
| 268 | 256 | mask.free; | |
| 269 | 257 | ||
| 270 | 258 | // Frame | |
| 271 | 259 | bmp6 := TBGRABitmap.Create( logo.Width,logo.Height ); | |
| 272 | 260 | bmp6.Rectangle( logo.ClientRect,BGRABlack, BGRA(0,0,0,0), dmDrawWithTransparency ); | |
| 273 | 261 | bmp6.DrawLine( 1, logo.Height-2, logo.Width-2, logo.Height-2, BGRA(0,0,0,75), True ); | |
| 274 | 262 | bmp6.DrawLine( logo.Width-2, 1, logo.Width-2, logo.Height-2, BGRA(0,0,0,75), True ); | |
| 275 | 263 | end; | |
| 276 | 264 | ||
| 277 | 265 | procedure DrawText; | |
| 278 | 266 | begin | |
| 279 | 267 | // Text | |
| 280 | 268 | bmp4 := TBGRABitmap.Create( logo.Width, logo.Height ); | |
| 281 | 269 | // 'Free Pascal' | |
| 282 | 270 | bmp5.FontAntialias := True; | |
| 283 | 271 | bmp5.FontStyle := [fsBold]; | |
| 284 | 272 | bmp5.FontHeight := Round(logo.Height*0.065); | |
| 285 | 273 | bmp5.TextOut( Round(logo.Width*0.15), Round(logo.Height*0.045), 'Free Pascal', BGRAWhite ); | |
| 286 | 274 | ||
| 287 | 275 | // 'Lazarus' | |
| 288 | 276 | bmp5.FontHeight := Round(logo.Height*0.18); | |
| 289 | 277 | bmp5.TextOut( Round(logo.Width*0.05), Round(logo.Height*0.07),'Lazarus',BGRAWhite ); | |
| 290 | 278 | ||
| 291 | 279 | // 'Project' | |
| 292 | 280 | bmp4.FontHeight := Round(logo.Height*0.052); | |
| 293 | 281 | bmp4.TextOut( Round(logo.Width*0.20), Round(logo.Height*0.27), 'Project', BGRAWhite ); | |
| 294 | 282 | ||
| 295 | 283 | // 'Write Once' | |
| 296 | 284 | bmp4.FontHeight := Round(logo.Height*0.07); | |
| 297 | 285 | bmp4.TextOut( Round(logo.Width*0.02), Round(logo.Height*0.57), 'Write Once', BGRA(255,255,255,100) ); | |
| 298 | 286 | bmp4.GradientFill( Round(logo.Width*0.02), Round(logo.Height*0.66), | |
| 299 | 287 | Round(logo.Width*0.46), Round(logo.Height*0.66)+1, | |
| 300 | 288 | BGRA(255,255,255,20), BGRA(0,0,0,30), gtLinear, | |
| 301 | 289 | PointF(logo.Width*0.22,0), PointF(logo.Width*0.48,0), | |
| 302 | 290 | dmDrawWithTransparency ); | |
| 303 | 291 | ||
| 304 | 292 | // 'Compile Anywhere' | |
| 305 | 293 | bmp4.TextOut( Round(logo.Width*0.26), Round(logo.Height*0.8), 'Compile Anywhere', BGRA(255,255,255,100) ); | |
| 306 | 294 | bmp4.GradientFill( Round(logo.Width*0.26), Round(logo.Height*0.89), | |
| 307 | 295 | Round(logo.Width*0.70), Round(logo.Height*0.89)+1, | |
| 308 | 296 | BGRA(255,255,255,20), BGRA(0,0,0,50), gtLinear, | |
| 309 | 297 | PointF(logo.Width*0.26,0), PointF(logo.Width*0.70,0), | |
| 310 | 298 | dmDrawWithTransparency ); | |
| 311 | 299 | end; | |
| 312 | 300 | ||
| 313 | 301 | procedure RedRectangle; | |
| 314 | 302 | var | |
| 315 | 303 | rct2: TRect; | |
| 316 | 304 | gradInfo: array of TnGradientInfo; | |
| 317 | 305 | bmpGrad: TBGRABitmap; | |
| 318 | 306 | begin | |
| 319 | 307 | bmp3 := TBGRABitmap.Create(logo.Width,logo.Height); | |
| 320 | 308 | ||
| 321 | 309 | rct2 := logo.ClientRect; | |
| 322 | 310 | rct2.Left := Round(rct2.Right*0.06); | |
| 323 | 311 | rct2.Top := Round(rct2.Bottom*0.27); | |
| 324 | 312 | rct2.Right := Round(rct2.Right*0.48); | |
| 325 | 313 | rct2.Bottom := Round(rct2.Bottom*0.337); | |
| 326 | 314 | ||
| 327 | 315 | setlength(gradInfo,4); // Red Alpha Gradient | |
| 328 | 316 | gradInfo[0] := nGradientInfo(BGRAPixelTransparent, BGRA(255,0,0,255), gdHorizontal, 0.25); | |
| 329 | 317 | gradInfo[1] := nGradientInfo(BGRA(255,0,0,255), BGRA(160,0,0,180), gdHorizontal, 0.5); | |
| 330 | 318 | gradInfo[2] := nGradientInfo(BGRA(160,0,0,180), BGRA(255,0,0,255), gdHorizontal, 0.75); | |
| 331 | 319 | gradInfo[3] := nGradientInfo(BGRA(255,0,0,255), BGRAPixelTransparent, gdHorizontal, 1); | |
| 332 | 320 | ||
| 333 | 321 | bmpGrad := nGradientAlphaFill( rct2, gdHorizontal, gradInfo ); | |
| 334 | 322 | bmp3.PutImage( rct2.Left, rct2.Top, bmpGrad, dmDrawWithTransparency ); | |
| 335 | 323 | bmpGrad.Free; | |
| 336 | 324 | end; | |
| 337 | 325 | ||
| 338 | 326 | procedure DrawPaw(bmp: TBGRABitmap; center: TPointF); | |
| 339 | 327 | begin | |
| 340 | 328 | with bmp.Canvas2D do | |
| 341 | 329 | begin | |
| 342 | 330 | save; | |
| 343 | 331 | translate(center.X-93,center.Y-83); | |
| 344 | 332 | globalAlpha := 0.4; | |
| 345 | 333 | fillStyle ('#3f5e99'); | |
| 346 | 334 | beginPath(); | |
| 347 | 335 | moveTo(89.724698,11.312043); | |
| 348 | 336 | bezierCurveTo(95.526308,14.494575,100.52322000000001,18.838808,102.75144,24.966412); | |
| 349 | 337 | bezierCurveTo(114.24578,26.586847,123.07072,43.010127999999995,118.71826,54.504664); | |
| 350 | 338 | bezierCurveTo(114.77805000000001,64.910473,93.426098,68.10145299999999,89.00143800000001,59.252123); | |
| 351 | 339 | bezierCurveTo(86.231818,53.712894999999996,90.877898,48.213108999999996,88.853498,42.139906999999994); | |
| 352 | 340 | bezierCurveTo(87.401408,37.78364299999999,82.208048,33.87411899999999,85.595888,27.098436999999993); | |
| 353 | 341 | bezierCurveTo(87.071858,24.146481999999992,94.76621800000001,25.279547999999995,94.863658,23.444067999999994); | |
| 354 | 342 | bezierCurveTo(95.066728,19.618834999999994,92.648878,18.165403999999995,90.221828,15.326465999999995); | |
| 355 | 343 | closePath(); | |
| 356 | 344 | fill(); | |
| 357 | 345 | beginPath(); | |
| 358 | 346 | moveTo(53.024288,20.876975); | |
| 359 | 347 | bezierCurveTo(50.128958,26.827119000000003,48.561707999999996,33.260252,50.284608,39.548662); | |
| 360 | 348 | bezierCurveTo(41.840728,47.513997,44.130318,66.017003,54.325338,72.88213300000001); | |
| 361 | 349 | bezierCurveTo(63.554708000000005,79.09700300000002,82.823918,69.36119300000001,81.320528,59.58223300000001); | |
| 362 | 350 | bezierCurveTo(80.379498,53.461101000000006,73.409408,51.65791100000001,71.551608,45.53168800000001); | |
| 363 | 351 | bezierCurveTo(70.219018,41.13739400000001,72.197818,34.94548700000001,65.517188,31.373877000000007); | |
| 364 | 352 | bezierCurveTo(62.606638000000004,29.817833000000007,56.98220800000001,35.18931200000001,55.841908000000004,33.74771500000001); | |
| 365 | 353 | bezierCurveTo(53.465478000000004,30.743354000000007,54.598668,28.159881000000006,54.938648,24.44039800000001); | |
| 366 | 354 | closePath(); | |
| 367 | 355 | fill(); | |
| 368 | 356 | beginPath(); | |
| 369 | 357 | moveTo(16.284108,78.650993); | |
| 370 | 358 | bezierCurveTo(16.615938,85.259863,18.344168,91.651623,22.885208,96.330453); | |
| 371 | 359 | bezierCurveTo(19.327327999999998,107.37975,30.253377999999998,122.48687000000001,42.495058,123.58667); | |
| 372 | 360 | bezierCurveTo(53.577238,124.58229,65.765908,106.76307,59.734438,98.920263); | |
| 373 | 361 | bezierCurveTo(55.959047999999996,94.01106300000001,48.983098,95.791453,44.402058,91.319753); | |
| 374 | 362 | bezierCurveTo(41.116108,88.112233,39.864737999999996,81.73340300000001,32.289848,81.824883); | |
| 375 | 363 | bezierCurveTo(28.989708,81.864783,26.651538,89.282293,24.957518,88.569003); | |
| 376 | 364 | bezierCurveTo(21.427108,87.08246299999999,21.174458,84.272723,19.679208,80.85010299999999); | |
| 377 | 365 | closePath(); | |
| 378 | 366 | fill(); | |
| 379 | 367 | beginPath(); | |
| 380 | 368 | moveTo(152.77652,37.616125); | |
| 381 | 369 | bezierCurveTo(156.68534,42.955439,159.37334,49.006564,158.79801,55.501293); | |
| 382 | 370 | bezierCurveTo(168.5256,61.835313,169.5682,80.450283,160.75895,89.021463); | |
| 383 | 371 | bezierCurveTo(152.78409,96.780823,132.08894,90.63274299999999,131.82654,80.742363); | |
| 384 | 372 | bezierCurveTo(131.6623,74.551503,138.19976,71.535693,138.93671,65.17653299999999); | |
| 385 | 373 | bezierCurveTo(139.46532,60.615162999999995,136.41531,54.87470199999999,142.35299,50.170306999999994); | |
| 386 | 374 | bezierCurveTo(144.93985,48.12074299999999,151.43107,52.404562999999996,152.29636,50.78291599999999); | |
| 387 | 375 | bezierCurveTo(154.09968999999998,47.403324999999995,152.52446999999998,45.062994999999994,151.52745,41.463536999999995); | |
| 388 | 376 | closePath(); | |
| 389 | 377 | fill(); | |
| 390 | 378 | beginPath(); | |
| 391 | 379 | moveTo(139.65359,109.38478); | |
| 392 | 380 | bezierCurveTo(179.13505,123.79982000000001,142.51298,146.31478,119.19800000000001,151.55864); | |
| 393 | 381 | bezierCurveTo(95.883018,156.8025,41.93790800000001,157.82316,75.508908,123.02183); | |
| 394 | 382 | bezierCurveTo(78.980078,119.42344999999999,79.61785800000001,104.19731999999999,82.074898,99.283253); | |
| 395 | 383 | bezierCurveTo(86.361158,93.329663,106.23528,86.908083,113.13709,88.929193); | |
| 396 | 384 | bezierCurveTo(128.23085,93.960443,125.96716,106.89633,139.65359,109.38478); | |
| 397 | 385 | closePath(); | |
| 398 | 386 | fill(); | |
| 399 | 387 | restore; | |
| 400 | 388 | end; | |
| 401 | 389 | end; | |
| 402 | 390 | ||
| 403 | 391 | begin | |
| 404 | 392 | DrawBackground; | |
| 405 | 393 | DrawEclipse; | |
| 406 | 394 | ThinCircleAndFrame; | |
| 407 | 395 | DrawText; | |
| 408 | 396 | RedRectangle; | |
| 409 | 397 | ||
| 410 | 398 | // Merge Bitmaps | |
| 411 | 399 | bmp.PutImage(0,0,bmp2,dmDrawWithTransparency); | |
| 412 | 400 | bmp.PutImage(0,0,bmp3,dmDrawWithTransparency); | |
| 413 | 401 | bmp.PutImage(0,0,bmp4,dmDrawWithTransparency); | |
| 414 | 402 | bmp.PutImage(0,0,bmp5,dmDrawWithTransparency); | |
| 415 | 403 | bmp.PutImage(0,0,bmp6,dmDrawWithTransparency); | |
| 416 | 404 | DrawPaw(bmp,PointF(258,161)); | |
| 417 | 405 | ||
| 418 | 406 | // Draw in Canvas | |
| 419 | 407 | bmp.Draw(logo.Canvas,0,0,True); | |
| 420 | 408 | ||
| 421 | 409 | // Free Bitmaps | |
| 422 | 410 | bmp.Free; | |
| 423 | 411 | bmp2.Free; | |
| 424 | 412 | bmp3.Free; | |
| 425 | 413 | bmp4.Free; | |
| 426 | 414 | bmp5.Free; | |
| 427 | 415 | bmp6.Free; | |
| 428 | 416 | end; | |
| 429 | 417 | ``` | |
| 430 | 418 | ||
| 431 | 419 | ### Shadow | |
| 432 | 420 | ||
| 433 | - | ||
| 434 | - | ||
| 435 | - | ||
| 436 | - | ||
| 421 | + |  | |
| 437 | 422 | ||
| 438 | 423 | Using the same code in BGRABitmap Tutorial 5 we can make a moon with shadow using the Shadow function. | |
| 439 | 424 | ||
| 440 | 425 | Go OnPaint event and add this code: | |
| 441 | 426 | ||
| 442 | 427 | ``` pascal | |
| 443 | 428 | procedure TForm1.FormPaint(Sender: TObject); | |
| 444 | 429 | var image: TBGRABitmap; | |
| 445 | 430 | size: single; | |
| 446 | 431 | ||
| 447 | 432 | // Shadow Function | |
| 448 | 433 | function Shadow(ASource: TBGRABitmap; AShadowColor: TBGRAPixel; AOffSetX,AOffSetY: Integer; ARadius: Integer; AShowSource: Boolean = True): TBGRABitmap; | |
| 449 | 434 | var | |
| 450 | 435 | bmpOut: TBGRABitmap; | |
| 451 | 436 | n: integer; | |
| 452 | 437 | p: PBGRAPixel; | |
| 453 | 438 | begin | |
| 454 | 439 | bmpOut:= TBGRABitmap.Create(ASource.Width+2*ARadius+AOffSetX,ASource.Height+2*ARadius+AOffSetY); | |
| 455 | 440 | ||
| 456 | 441 | bmpOut.PutImage(AOffSetX,AOffSetY,ASource,dmDrawWithTransparency); | |
| 457 | 442 | ||
| 458 | 443 | p := bmpOut.Data; | |
| 459 | 444 | for n := 1 to bmpOut.NbPixels do begin | |
| 460 | 445 | if p^.alpha <> 0 then begin | |
| 461 | 446 | p^.red := AShadowColor.red; | |
| 462 | 447 | p^.green := AShadowColor.green; | |
| 463 | 448 | p^.blue := AShadowColor.blue; | |
| 464 | 449 | end; | |
| 465 | 450 | inc(p); | |
| 466 | 451 | end; | |
| 467 | 452 | ||
| 468 | 453 | BGRAReplace(bmpOut,bmpOut.FilterBlurRadial(ARadius,rbFast)); | |
| 469 | 454 | ||
| 470 | 455 | if AShowSource = True then bmpOut.PutImage(0,0,ASource,dmDrawWithTransparency); | |
| 471 | 456 | ||
| 472 | 457 | Result:= bmpOut; | |
| 473 | 458 | end; | |
| 474 | 459 | ||
| 475 | 460 | procedure DrawMoon; | |
| 476 | 461 | var layer: TBGRABitmap; | |
| 477 | 462 | begin | |
| 478 | 463 | layer := TBGRABitmap.Create(image.Width,image.Height); | |
| 479 | 464 | layer.FillEllipseAntialias(layer.Width/2,layer.Height/2,size*0.4,size*0.4,BGRA(224,224,224,128)); | |
| 480 | 465 | layer.EraseEllipseAntialias(layer.Width/2+size*0.15,layer.Height/2,size*0.3,size*0.3,255); | |
| 481 | 466 | BGRAReplace(layer,Shadow(layer,BGRABlack,5,5,5)); | |
| 482 | 467 | image.PutImage(0,0,layer,dmDrawWithTransparency); | |
| 483 | 468 | layer.Free; | |
| 484 | 469 | end; | |
| 485 | 470 | ||
| 486 | 471 | begin | |
| 487 | 472 | image := TBGRABitmap.Create(ClientWidth,ClientHeight); | |
| 488 | 473 | ||
| 489 | 474 | //Compute available space in both directions | |
| 490 | 475 | if image.Height < image.Width then | |
| 491 | 476 | size := image.Height | |
| 492 | 477 | else | |
| 493 | 478 | size := image.Width; | |
| 494 | 479 | ||
| 495 | 480 | image.GradientFill(0,0,image.Width,image.Height, | |
| 496 | 481 | BGRA(128,192,255),BGRA(0,0,255), | |
| 497 | 482 | gtLinear,PointF(0,0),PointF(0,image.Height), | |
| 498 | 483 | dmSet); | |
| 499 | 484 | ||
| 500 | 485 | DrawMoon; | |
| 501 | 486 | ||
| 502 | 487 | image.Draw(Canvas,0,0,True); | |
| 503 | 488 | image.free; | |
| 504 | 489 | end; | |
| 505 | 490 | ``` | |
| 506 | 491 | ||
| 507 | 492 | ### Text Shadow | |
| 508 | 493 | ||
| 509 | 494 | Usage of BGRABitmap TextShadow function, create cool text with blured shadows and custom font properties. | |
| 510 | 495 | ||
| 511 | 496 | #### Single & Multi-Shadow | |
| 512 | 497 | ||
| 513 | - | ||
| 514 | - | ||
| 515 | - | ||
| 516 | - | ||
| 498 | + |  | |
| 517 | 499 | ||
| 518 | 500 | This requires BGRABitmap, BGRABitmapTypes & BGRAGradients. | |
| 519 | 501 | ||
| 520 | 502 | Go OnPaint event and add this code: | |
| 521 | 503 | ||
| 522 | 504 | ``` pascal | |
| 523 | 505 | procedure TForm1.FormPaint(Sender: TObject); | |
| 524 | 506 | var | |
| 525 | 507 | bmp1,bmp2: TBGRABitmap; txt: String; | |
| 526 | 508 | begin | |
| 527 | 509 | txt:= 'TextShadow!'; | |
| 528 | 510 | ||
| 529 | 511 | // Simple Shadow | |
| 530 | 512 | bmp1:= TextShadow(200,40,txt,32,BGRAWhite,BGRABlack,1,1); | |
| 531 | 513 | bmp1.Draw(Canvas,0,0,False); | |
| 532 | 514 | bmp1.Free; | |
| 533 | 515 | ||
| 534 | 516 | // Blured Shadow | |
| 535 | 517 | bmp1:= TextShadow(200,40,txt,32,BGRABlack,BGRA(128,128,255,255),4,4,5); | |
| 536 | 518 | bmp1.Draw(Canvas,0,40,False); | |
| 537 | 519 | bmp1.Free; | |
| 538 | 520 | ||
| 539 | 521 | // Neon Shadow ''(better with Black background)'' | |
| 540 | 522 | bmp1:= TextShadow(200,40,txt,32,BGRA(255,255,255,200),BGRA(0,255,0,255),0,0,5); | |
| 541 | 523 | bmp1.Draw(Canvas,0,80,False); | |
| 542 | 524 | bmp1.Free; | |
| 543 | 525 | ||
| 544 | 526 | // Multi Shadow | |
| 545 | 527 | bmp1:= TextShadow(250,50,txt,32,BGRAWhite,BGRA(255,0,0,255),-5,-5,4,[fsBold,fsUnderline],'Tahoma',False); | |
| 546 | 528 | bmp2:= TextShadow(250,50,txt,32,BGRAWhite,BGRA(0,0,255,255),5,5,4,[fsBold,fsUnderline],'Tahoma',True); | |
| 547 | 529 | bmp1.PutImage(0,0,bmp2,dmDrawWithTransparency); | |
| 548 | 530 | bmp1.Draw(Canvas,0,120,False); | |
| 549 | 531 | bmp1.Free; | |
| 550 | 532 | bmp2.Free; | |
| 551 | 533 | end; | |
| 552 | 534 | ``` | |
| 553 | 535 | ||
| 554 | 536 | #### Stretch to Form height | |
| 555 | 537 | ||
| 556 | - | ||
| 557 | - | ||
| 558 | - | ||
| 559 | - | ||
| 538 | + |  | |
| 560 | 539 | ||
| 561 | 540 | Go OnPaint event and add this code: | |
| 562 | 541 | ||
| 563 | 542 | ``` pascal | |
| 564 | 543 | procedure TForm1.FormPaint(Sender: TObject); | |
| 565 | 544 | var | |
| 566 | 545 | bmp: TBGRABitmap; | |
| 567 | 546 | begin | |
| 568 | 547 | Color:= clBlack; | |
| 569 | 548 | bmp:= TextShadow(Width,Height,'Shadow',Round(Height*0.5),BGRA(128,0,0,255),BGRAWhite,10,10,5,[fsBold],'Chiller'); | |
| 570 | 549 | bmp.Draw(Canvas,0,0,False); | |
| 571 | 550 | bmp.Free; | |
| 572 | 551 | end; | |
| 573 | 552 | ``` | |
| 574 | 553 | ||
| 575 | 554 | ### Text Outline | |
| 576 | 555 | ||
| 577 | 556 | If you need quality text outline use BGRABitmap Text Effect unit. | |
| 578 | 557 | ||
| 579 | - | ||
| 580 | - | ||
| 581 | - | ||
| 582 | - | ||
| 558 | + |  | |
| 583 | 559 | ||
| 584 | 560 | Go OnPaint event and add this code: | |
| 585 | 561 | ||
| 586 | 562 | ``` pascal | |
| 587 | 563 | uses Types; | |
| 588 | 564 | ||
| 589 | 565 | procedure TForm1.FormPaint(Sender: TObject); | |
| 590 | 566 | const textContent = 'Some text'; fontheight = 30; | |
| 591 | 567 | var image,textBmp,outline: TBGRABitmap; | |
| 592 | 568 | size: TSize; | |
| 593 | 569 | p: PBGRAPixel; | |
| 594 | 570 | n: Integer; | |
| 595 | 571 | begin | |
| 596 | 572 | image := TBGRABitmap.Create(ClientWidth,ClientHeight, ColorToBGRA(ColorToRGB(clBtnFace)) ); | |
| 597 | 573 | ||
| 598 | 574 | //define font param | |
| 599 | 575 | image.FontAntialias := true; | |
| 600 | 576 | image.FontHeight := fontheight; | |
| 601 | 577 | image.FontStyle := [fsBold]; | |
| 602 | 578 | ||
| 603 | 579 | //create text image | |
| 604 | 580 | size := image.TextSize(textContent); | |
| 605 | 581 | textBmp := TBGRABitmap.Create(size.cx+2,size.cy+2,BGRAWhite); | |
| 606 | 582 | image.CopyPropertiesTo(textBmp); | |
| 607 | 583 | textBmp.TextOut(1,1,textContent,BGRABlack); | |
| 608 | 584 | ||
| 609 | 585 | //create outline | |
| 610 | 586 | outline := textbmp.FilterContour as TBGRABitmap; | |
| 611 | 587 | textBmp.Free; | |
| 612 | 588 | p := outline.data; | |
| 613 | 589 | for n := 0 to outline.NbPixels-1 do | |
| 614 | 590 | begin | |
| 615 | 591 | p^.alpha := 255-(GammaExpansionTab[p^.red] shr 8); | |
| 616 | 592 | p^.red := 0; //outline color | |
| 617 | 593 | p^.green := 0; | |
| 618 | 594 | p^.blue := 192; | |
| 619 | 595 | inc(p); | |
| 620 | 596 | end; | |
| 621 | 597 | ||
| 622 | 598 | //draw outline | |
| 623 | 599 | image.PutImage(20-1,20-1,outline,dmDrawWithTransparency); | |
| 624 | 600 | outline.Free; | |
| 625 | 601 | ||
| 626 | 602 | //draw inner text | |
| 627 | 603 | image.TextOut(20,20,textContent,BGRAWhite); | |
| 628 | 604 | ||
| 629 | 605 | image.Draw(Canvas,0,0,True); | |
| 630 | 606 | image.free; | |
| 631 | 607 | end; | |
| 632 | 608 | ``` | |
| 633 | 609 | ||
| 634 | 610 | ### Three-State Button | |
| 635 | 611 | ||
| 636 | 612 | This way to create a Three-State Button is obsolete. Now you can use [[BGRAControls]] and add TBGRAButton that is a fully customizable button. You can see some examples in the [[BGRAButton Gallery]]. | |
| 637 | 613 | ||
| 638 | - | ||
| 639 | - | ||
| 640 | - | ||
| 641 | - | ||
| 614 | + |  | |
| 642 | 615 | ||
| 643 | 616 | This is how to create a 3 state button ('Normal','Enter','Pressed') with a [[PaintBox]] & [[BGRABitmap]]. | |
| 644 | 617 | ||
| 645 | 618 | **1) Add a new PaintBox:** | |
| 646 | 619 | ||
| 647 | 620 | Name=btn | |
| 648 | 621 | ||
| 649 | 622 | Width=128 | |
| 650 | 623 | ||
| 651 | 624 | Height=64 | |
| 652 | 625 | ||
| 653 | 626 | **2) Add this code:** | |
| 654 | 627 | ||
| 655 | 628 | ``` pascal | |
| 656 | 629 | unit Unit1; | |
| 657 | 630 | ||
| 658 | 631 | {$mode objfpc}{$H+} | |
| 659 | 632 | ||
| 660 | 633 | interface | |
| 661 | 634 | ||
| 662 | 635 | uses | |
| 663 | 636 | Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, | |
| 664 | 637 | BGRABitmap, BGRABitmapTypes, BGRAGradients; | |
| 665 | 638 | ||
| 666 | 639 | type | |
| 667 | 640 | ||
| 668 | 641 | { TForm1 } | |
| 669 | 642 | ||
| 670 | 643 | TForm1 = class(TForm) | |
| 671 | 644 | btn: TPaintBox; | |
| 672 | 645 | procedure btnPaint(Sender: TObject); | |
| 673 | 646 | procedure btnMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); | |
| 674 | 647 | procedure btnMouseEnter(Sender: TObject); | |
| 675 | 648 | procedure btnMouseLeave(Sender: TObject); | |
| 676 | 649 | procedure btnMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); | |
| 677 | 650 | procedure FormCreate(Sender: TObject); | |
| 678 | 651 | procedure FormDestroy(Sender: TObject); | |
| 679 | 652 | private | |
| 680 | 653 | { private declarations } | |
| 681 | 654 | btnCaption: String; | |
| 682 | 655 | btnState: String; | |
| 683 | 656 | public | |
| 684 | 657 | { public declarations } | |
| 685 | 658 | end; | |
| 686 | 659 | ||
| 687 | 660 | function DrawButton(ARect: TRect; AText: String; cl1,cl2,cl3,cl4: TBGRAPixel; AValue: Single): TBGRABitmap; | |
| 688 | 661 | ||
| 689 | 662 | var | |
| 690 | 663 | Form1: TForm1; | |
| 691 | 664 | ||
| 692 | 665 | implementation | |
| 693 | 666 | ||
| 694 | 667 | function DrawButton(ARect: TRect; AText: String; cl1,cl2,cl3,cl4: TBGRAPixel; AValue: Single): TBGRABitmap; | |
| 695 | 668 | var | |
| 696 | 669 | bmpBtn,bmpTxt: TBGRABitmap; | |
| 697 | 670 | begin | |
| 698 | 671 | bmpBtn:= DoubleGradientAlphaFill(ARect,cl1,cl2,cl3,cl4,gdVertical,gdVertical,gdVertical,AValue); | |
| 699 | 672 | bmpBtn.Rectangle(0,0,ARect.Right,ARect.Bottom,BGRA(0,0,0,150),dmDrawWithTransparency); | |
| 700 | 673 | bmpTxt:= TextShadow(ARect.Right,ARect.Bottom,AText,Round(ARect.Bottom*0.5),BGRAWhite,BGRABlack,1,1,1); | |
| 701 | 674 | bmpBtn.PutImage(0,0,bmpTxt,dmDrawWithTransparency); | |
| 702 | 675 | bmpTxt.Free; | |
| 703 | 676 | Result:=bmpBtn; | |
| 704 | 677 | end; | |
| 705 | 678 | ||
| 706 | 679 | {$R *.lfm} | |
| 707 | 680 | ||
| 708 | 681 | { TForm1 } | |
| 709 | 682 | ||
| 710 | 683 | procedure TForm1.btnPaint(Sender: TObject); | |
| 711 | 684 | var | |
| 712 | 685 | bmpBtn: TBGRABitmap; | |
| 713 | 686 | begin | |
| 714 | 687 | if btnState = 'Normal' then begin | |
| 715 | 688 | bmpBtn:= DrawButton(btn.ClientRect,btnCaption,BGRABlack,BGRAWhite,BGRAWhite,BGRABlack,0.5); end | |
| 716 | 689 | else if btnState = 'Pressed' then begin | |
| 717 | 690 | bmpBtn:= DrawButton(btn.ClientRect,btnCaption,BGRAWhite,BGRABlack,BGRABlack,BGRAWhite,0.5); end | |
| 718 | 691 | else if btnState = 'Enter' then begin | |
| 719 | 692 | bmpBtn:= DrawButton(btn.ClientRect,btnCaption,BGRA(100,100,100,255),BGRAWhite,BGRAWhite,BGRA(100,100,100,255),0.5); | |
| 720 | 693 | end; | |
| 721 | 694 | bmpBtn.Draw(btn.Canvas,0,0,False); | |
| 722 | 695 | bmpBtn.Free; | |
| 723 | 696 | end; | |
| 724 | 697 | ||
| 725 | 698 | procedure TForm1.btnMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); | |
| 726 | 699 | begin | |
| 727 | 700 | btnState:= 'Pressed'; | |
| 728 | 701 | btnPaint(nil); | |
| 729 | 702 | end; | |
| 730 | 703 | ||
| 731 | 704 | procedure TForm1.btnMouseEnter(Sender: TObject); | |
| 732 | 705 | begin | |
| 733 | 706 | btnState:= 'Enter'; | |
| 734 | 707 | btnPaint(nil); | |
| 735 | 708 | end; | |
| 736 | 709 | ||
| 737 | 710 | procedure TForm1.btnMouseLeave(Sender: TObject); | |
| 738 | 711 | begin | |
| 739 | 712 | btnState:= 'Normal'; | |
| 740 | 713 | btnPaint(nil); | |
| 741 | 714 | end; | |
| 742 | 715 | ||
| 743 | 716 | procedure TForm1.btnMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); | |
| 744 | 717 | begin | |
| 745 | 718 | btnState:= 'Enter'; | |
| 746 | 719 | btnPaint(nil); | |
| 747 | 720 | end; | |
| 748 | 721 | ||
| 749 | 722 | procedure TForm1.FormCreate(Sender: TObject); | |
| 750 | 723 | begin | |
| 751 | 724 | btnCaption:= 'Button'; | |
| 752 | 725 | btnState:= 'Normal'; | |
| 753 | 726 | end; | |
| 754 | 727 | ||
| 755 | 728 | procedure TForm1.FormDestroy(Sender: TObject); | |
| 756 | 729 | begin | |
| 757 | 730 | btn.Free; | |
| 758 | 731 | end; | |
| 759 | 732 | ||
| 760 | 733 | end. | |
| 761 | 734 | ``` | |
| 762 | 735 | ||
| 763 | 736 | --- | |
| 764 | 737 | *From the Free Pascal wiki, page "Sample Graphics", as it stood on 2020-02-26 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* |
