Changeset 36
- Timestamp:
- May 4, 2018, 1:36:00 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.lfm
r35 r36 1 1 object FormMain: TFormMain 2 Left = 6482 Left = 546 3 3 Height = 640 4 Top = 3 234 Top = 316 5 5 Width = 920 6 6 Caption = 'LibrePaint' -
trunk/Forms/UFormMain.pas
r35 r36 223 223 P := Core.Project.View.DestToSrcPos(Point(X, Y)); 224 224 if (P.X >= 0) and (P.X < Core.Project.Bitmap.Size.X) and (P.Y >= 0) and (P.Y < Core.Project.Bitmap.Size.Y) then 225 Core.Project.Bitmap. Pixels[P.X, P.Y] := TFColor.Create(Core.Project.Bitmap.ColorFormat, ColorButton1.ButtonColor);225 Core.Project.Bitmap.Canvas.Pen.MoveTo(Point(P.X, P.Y)); 226 226 Redraw; 227 227 end; … … 253 253 if ImageTool = itPen then begin 254 254 P := Core.Project.View.DestToSrcPos(Point(X, Y)); 255 if (P.X >= 0) and (P.X < Core.Project.Bitmap.Size.X) and (P.Y >= 0) and (P.Y < Core.Project.Bitmap.Size.Y) then 256 Core.Project.Bitmap.Pixels[P.X, P.Y] := TFColor.Create(Core.Project.Bitmap.ColorFormat, ColorButton1.ButtonColor); 255 if (P.X >= 0) and (P.X < Core.Project.Bitmap.Size.X) and (P.Y >= 0) and (P.Y < Core.Project.Bitmap.Size.Y) then begin 256 Core.Project.Bitmap.Canvas.Pen.Color := TFColor.Create(Core.Project.Bitmap.ColorFormat, ColorButton1.ButtonColor); 257 Core.Project.Bitmap.Canvas.Pen.LineTo(Point(P.X, P.Y)); 258 end; 257 259 Redraw; 258 260 end; -
trunk/Packages/FastGraphics/ColorFormats/UColorRGB8.pas
r31 r36 47 47 FillCallBack: TGetColorPos; 48 48 function FillGetColor(Position: TPoint): TColorRGB8; 49 function NegativeFunc(Position: TPoint): TColorRGB8; 49 50 protected 50 51 function GetPixel(X, Y: Integer): IBColor; override; … … 55 56 procedure Mirror; override; 56 57 procedure Flip; override; 58 procedure Negative; override; 57 59 procedure Fill(Color: IBColor); override; 58 60 procedure Fill(Func: TGetColorPos); override; 61 procedure Line(P1, P2: TPoint; Color: IBColor); override; 59 62 procedure PaintToCanvas(Canvas: TCanvas); override; 60 63 procedure PaintToCanvas(Canvas: TCanvas; Rect: TRect); override; … … 143 146 end; 144 147 148 function TBPixmapRGB8.NegativeFunc(Position: TPoint): TColorRGB8; 149 var 150 C: TColorRGB8; 151 begin 152 C := Pixmap.Pixels[Position.X, Position.Y]; 153 Result.R := 255 - C.R; 154 Result.G := 255 - C.G; 155 Result.B := 255 - C.B; 156 end; 157 145 158 function TBPixmapRGB8.GetPixel(X, Y: Integer): IBColor; 146 159 begin … … 169 182 end; 170 183 184 procedure TBPixmapRGB8.Negative; 185 begin 186 Pixmap.Fill(NegativeFunc); 187 end; 188 171 189 procedure TBPixmapRGB8.Fill(Color: IBColor); 172 190 begin … … 181 199 end; 182 200 201 procedure TBPixmapRGB8.Line(P1, P2: TPoint; Color: IBColor); 202 begin 203 Pixmap.Canvas.Pen.Color := (Color as TBColorRGB8).Value; 204 Pixmap.Canvas.Pen.MoveTo(P1); 205 Pixmap.Canvas.Pen.LineTo(P2); 206 end; 207 183 208 procedure TBPixmapRGB8.PaintToCanvas(Canvas: TCanvas); 184 209 begin -
trunk/Packages/FastGraphics/UFGraphics.pas
r33 r36 42 42 procedure Mirror; virtual; 43 43 procedure Flip; virtual; 44 procedure Negative; virtual; 44 45 procedure Fill(Color: IBColor); virtual; overload; 45 46 procedure Fill(Func: TGetColorPos); virtual; overload; … … 391 392 procedure TBImage.Mirror; 392 393 begin 393 394 394 end; 395 395 396 396 procedure TBImage.Flip; 397 begin 398 end; 399 400 procedure TBImage.Negative; 397 401 begin 398 402 end; … … 505 509 procedure TFPixmap.Negative; 506 510 begin 507 511 FBackend.Negative; 508 512 end; 509 513 -
trunk/Packages/FastGraphics/UGGraphics.pas
r35 r36 344 344 for X := 0 to FSize.X - 1 do begin 345 345 if (X >= 0) and (X < FSize.X) and (Y >= 0) and (Y < FSize.Y) then 346 P Integer(DstPtr.Pixel)^ := ColorConvertFunc(PInteger(SrcPtr.Pixel)^);346 PGColor(DstPtr.Pixel)^ := ColorConvertFunc(PInteger(SrcPtr.Pixel)^); 347 347 SrcPtr.NextPixel; 348 348 DstPtr.NextPixel; -
trunk/UCore.lfm
r31 r36 3 3 OnDestroy = DataModuleDestroy 4 4 OldCreateOrder = False 5 Height = 491 6 HorizontalOffset = 838 7 VerticalOffset = 420 8 Width = 857 5 Height = 614 6 HorizontalOffset = 799 7 VerticalOffset = 416 8 Width = 1071 9 PPI = 120 9 10 object ActionList1: TActionList 10 11 Images = ImageList1 11 left = 2 0112 top = 16012 left = 251 13 top = 200 13 14 object AExit: TAction 14 15 Caption = 'Exit' … … 107 108 end 108 109 object ImageList1: TImageList 109 left = 2 00110 top = 240110 left = 250 111 top = 300 111 112 end 112 113 object OpenPictureDialog1: TOpenPictureDialog 113 left = 462114 top = 1 26114 left = 578 115 top = 158 115 116 end 116 117 object SavePictureDialog1: TSavePictureDialog 117 left = 462118 top = 2 08118 left = 578 119 top = 260 119 120 end 120 121 object PersistentForm1: TPersistentForm 121 122 MinVisiblePart = 50 122 123 EntireVisible = False 123 left = 64124 top = 48124 left = 80 125 top = 60 125 126 end 126 127 object ApplicationInfo1: TApplicationInfo … … 139 140 RegistryRoot = rrKeyCurrentUser 140 141 License = 'CC0' 141 left = 62142 top = 1 33142 left = 78 143 top = 166 143 144 end 144 145 end -
trunk/UCore.pas
r33 r36 234 234 procedure TCore.AFileSaveAsExecute(Sender: TObject); 235 235 begin 236 SavePictureDialog1.FileName := Project.FileName; 236 SavePictureDialog1.InitialDir := ExtractFileDir(Project.FileName); 237 SavePictureDialog1.FileName := ExtractFileName(Project.FileName); 237 238 if SavePictureDialog1.Execute then begin 238 239 Project.FileName := SavePictureDialog1.FileName; … … 251 252 Image := TImage.Create(nil); 252 253 Image.Picture.Bitmap.SetSize(Project.Bitmap.Size.X, Project.Bitmap.Size.Y); 253 Project.Bitmap.PaintTo Canvas(Image.Picture.Bitmap.Canvas,254 Project.Bitmap.PaintToBitmap(Image.Picture.Bitmap, 254 255 Rect(0, 0, Image.Picture.Bitmap.Width, Image.Picture.Bitmap.Height)); 255 256 Image.Picture.SaveToFile(SavePictureDialog1.FileName);
Note:
See TracChangeset
for help on using the changeset viewer.