Bmp.Draw(Canvas,rect(0,0,ClientWidth,ClientHeight),True);
Very nice circular !this is already better than mspaint !if i can suggest you for the next steps:- add select tool- filters apply only on selection- a script language for custom filters (pascal script or lua) (or be able to use Gimp ones- filename in titlebar + multiple images open in tabs?
I was trying to manufacture a similar program the Library "bgrabitmap" in ubuntu is slow ..."rather"
# notingYou can change the place of drawing in the windowIn the example with the library Unit1.pas / line 274Code: [Select] Bmp.Draw(Canvas,rect(0,0,ClientWidth,ClientHeight),True);0,0 is The beginning of the drawing in the window
# noting2Can not compile your program linux I think the problem in "bgrabitmap"
Part of it depends on the freepascal compiler, which does not produce very efficient code
QuotePart of it depends on the freepascal compiler, which does not produce very efficient codeReally? How can you say so?
mov SELF,rcx //p := self.Data; callq GetDataPtr mov rax, P mov SELF,rax //n := self.NbPixels-1; movslq (rax).NBPIXELS,rax dec rax mov eax, N cmpl $00, N //if n<0 then goto @endloop; jl @endloop incl N //inc(n); nop //useless @iteration: decl N //dec(n); mov P,rax //if p^.alpha = 0 then goto @transparent; movzbl 0x3(rax),eax test rax,rax //(!) this seems to be wrong, it should test eax je @transparent mov P,rax //p^.red := 255-p^.red; movzbl 0x2(rax),edx mov $00000000000000FF,rax sub rdx,rax mov rax,rdx mov P,rax mov dl,0x2(rax) mov P,rax //p^.green := 255-p^.green; movzbl 0x1(rax),edx mov $00000000000000FF,rax sub rdx,rax mov rax,rdx mov P,rax mov dl,0x1(rax) mov P,rax //p^.blue := 255-p^.blue; movzbl (rax),edx mov $00000000000000FF,rax sub rdx,rax mov rax,rdx mov P,rax mov dl,(rax) @transparent: addq $04, P //inc(p); cmpl $00, N //if N > 0 then goto @iteration; jg @iteration @endloop:
mov SELF,rcx //p := self.Data; callq GetDataPtr mov rax, rdi //( p -> rdi ) mov SELF,rax //n := self.NbPixels-1; movslq (rax).NBPIXELS,rdx dec rdx //( n -> rdx ) js @endloop //if n<0 then goto @endloop; xor ecx, ecx @iteration: cmp 0x3(rdi),ecl //if p^.alpha = 0 then goto @transparent; je @transparent mov P,rax notb 0x2(rdi) //p^.red := 255-p^.red; notb 0x1(rdi) //p^.green := 255-p^.green; notb (rdi) //p^.blue := 255-p^.blue; @transparent: add $04, rdi //inc(p); dec rdx //dec(n); jns @iteration //if N >= 0 then goto @iteration; @endloop:
A number of issues on OS X / Carbon:- See screenshot. Toolbar is rather messed up.
- Once the Colors dialog comes up, then no matter where I click on toolbar, the Colors dialog comes up again.
- Tools dialogs moves after any dialog is displayed.
- Usual sorts of things that one sees in an app that is not optimized for Mac: two Quit menu commands, wrong shortcuts for things like Undo (Cmd+Z, not Ctrl+Z).
- Is there no copy and paste support? If so, they should have Edit menu commands.
- Seems to be kind of bilingual. Open dialog title is in English, Save dialog title is in French.
When I reposition to Tools dialog, then bring up, say, Open dialog (which hides Tools dialog, it appears), then after Open is dismissed, the Tools dialog moves back to some other position instead of the position I moved it to.
I haven't looked at it beyond just the UI.
This could be simplified by the compiler in something like
procedure WMEraseBkgnd(var Message: TLMEraseBkgnd); message LM_ERASEBKGND;.......implementation.......procedure TFMain.WMEraseBkgnd(var Message: TLMEraseBkgnd);begin // block Erasing background // inherited EraseBackground(DC);end;
Quote from: Leledumbo on February 06, 2011, 04:39:52 pmQuotePart of it depends on the freepascal compiler, which does not produce very efficient codeReally? How can you say so?Because I've looked at the generated asm code. For example, with this Pascal code :Code: Pascal [Select] p := Data; for n := NbPixels-1 downto 0 do //iteration begin if p^.alpha <> 0 then begin p^.red := 255-p^.red; p^.green := 255-p^.green; p^.blue := 255-p^.blue; end; //else transparent inc(p); end; //endloop It gives an assembly code Which can be interpreted as :Code: [Select] mov SELF,rcx //p := self.Data; callq GetDataPtr mov rax, P mov SELF,rax //n := self.NbPixels-1; movslq (rax).NBPIXELS,rax dec rax mov eax, N cmpl $00, N //if n<0 then goto @endloop; jl @endloop incl N //inc(n); nop //useless @iteration: decl N //dec(n); mov P,rax //if p^.alpha = 0 then goto @transparent; movzbl 0x3(rax),eax test rax,rax //(!) this seems to be wrong, it should test eax je @transparent mov P,rax //p^.red := 255-p^.red; movzbl 0x2(rax),edx mov $00000000000000FF,rax sub rdx,rax mov rax,rdx mov P,rax mov dl,0x2(rax) mov P,rax //p^.green := 255-p^.green; movzbl 0x1(rax),edx mov $00000000000000FF,rax sub rdx,rax mov rax,rdx mov P,rax mov dl,0x1(rax) mov P,rax //p^.blue := 255-p^.blue; movzbl (rax),edx mov $00000000000000FF,rax sub rdx,rax mov rax,rdx mov P,rax mov dl,(rax) @transparent: addq $04, P //inc(p); cmpl $00, N //if N > 0 then goto @iteration; jg @iteration @endloop: This could be simplified by the compiler in something like : Code: [Select] mov SELF,rcx //p := self.Data; callq GetDataPtr mov rax, rdi //( p -> rdi ) mov SELF,rax //n := self.NbPixels-1; movslq (rax).NBPIXELS,rdx dec rdx //( n -> rdx ) js @endloop //if n<0 then goto @endloop; xor ecx, ecx @iteration: cmp 0x3(rdi),ecl //if p^.alpha = 0 then goto @transparent; je @transparent mov P,rax notb 0x2(rdi) //p^.red := 255-p^.red; notb 0x1(rdi) //p^.green := 255-p^.green; notb (rdi) //p^.blue := 255-p^.blue; @transparent: add $04, rdi //inc(p); dec rdx //dec(n); jnz @iteration //if N <> 0 then goto @iteration; @endloop:
mov SELF,rcx //p := self.Data; callq GetDataPtr mov rax, rdi //( p -> rdi ) mov SELF,rax //n := self.NbPixels-1; movslq (rax).NBPIXELS,rdx dec rdx //( n -> rdx ) js @endloop //if n<0 then goto @endloop; xor ecx, ecx @iteration: cmp 0x3(rdi),ecl //if p^.alpha = 0 then goto @transparent; je @transparent mov P,rax notb 0x2(rdi) //p^.red := 255-p^.red; notb 0x1(rdi) //p^.green := 255-p^.green; notb (rdi) //p^.blue := 255-p^.blue; @transparent: add $04, rdi //inc(p); dec rdx //dec(n); jnz @iteration //if N <> 0 then goto @iteration; @endloop: