graphics32

Delphi Graphics32 combining normal layers with drawing layers

只谈情不闲聊 提交于 2019-12-12 02:04:13
问题 By drawing layer I mean a layer where the user can manually draw lines, circles or other shapes. And by normal layers I mean the layers described in the graphics32 layers example (the layers that can be moved or resized at runtime using mouse events) So I am having difficulties combining these 2 types of layers. In my test project, for now, I will assume I only have one drawing layer and multiple PNG layers. So in my project I set properties for the ImgView32 in the OnFormCreate like:

Delphi freeze on Form close with custom component

匆匆过客 提交于 2019-12-10 22:17:13
问题 I have developed a component to implement pan and zoom functionality for Graphics32 based ImgView32s. One can drop the component next to an TImgView32, set the Image view property of my component and all is good, and working as expected. However, once I try to close the Form hosting my component and the ImgView32 the Delphi IDE freezes. My first thought was that the ImgView32 while still linked to my component gets destroyed before my component, so I implemented the Delphi standard

Delphi - Graphics32, draw antialiased rounded rectangle

ⅰ亾dé卋堺 提交于 2019-12-10 20:48:49
问题 How can I draw an anti-aliased rounded corners rectangle using Graphics32? I managed to make a normal rectangle with TPolygon onto the bitmap32 canvas, but I cant find any reference to drawing rounded corners. Would appreciate some code. 回答1: function GetRoundedFixedRectanglePoints(const Rect: TFloatRect; dx, dy: single): TArrayOfFixedPoint; var i, j, k, arcLen: integer; arcs: array [0 .. 3] of TArrayOfFixedPoint; begin //nb: it's simpler to construct the rounded rect in an anti-clockwise /

Delphi Graphics32 relative mouse position (to the layer)

╄→尐↘猪︶ㄣ 提交于 2019-12-01 08:59:08
问题 I have a ImgView32, that is anchored to all form margins. The form is maximized. The bitmap of ImgView is not fixed (it can be of different sizes) I am trying to draw a line on a transparent layer using ther code from this question:Drawing lines on layer Now the problem is that, using that exact code, I can only draw in the top-left corner, like in this image: As you can observe, the lines can be drawn only in the left top corner. If I try to add some value to the Start and End Points, the

Delphi, GR32 + PngObject: converting to Bitmap32 doesn't work as expected

有些话、适合烂在心里 提交于 2019-11-30 15:17:57
I'm using GR32 for drawing multiple semi-transparent PNG images. So far I've been using the following method: png:= TPNGObject.Create; png.LoadFromFile(...); PaintBox321.Buffer.Canvas.Draw(120, 20, png); however I wanted to switch to the method proposed on GR32 website ( http://graphics32.org/wiki/FAQ/ImageFormatRelated ) : tmp:= TBitmap32.Create; LoadPNGintoBitmap32(tmp, ..., foo); tmp.DrawMode:= dmBlend; PaintBox321.Buffer.Draw(Rect(20, 20, 20+ tmp.Width, 20+tmp.Height), tmp.ClipRect, tmp); While the first method works perfectly fine, the second - which should give the same result - causes

Transparent Png to TBitmap32

不羁岁月 提交于 2019-11-28 11:35:22
I have a png that i would like to load in a TBitmap32. After I load the bitmap I call: Bitmap.DrawMode := dmTransparent; Bitmap.OuterColor := Bitmap.PixelS[0,0]; But then all white pixels are transparent. How can i do that just for the transparent part of the png image? Here is my image with the alpha transparency around the edge of the image indicated in the standard way. And this is the actual image: It seems that TBitmap32 may lose alpha information while loading a PNG image. You may consider to use the GR32PNG library of which a documentation excerpt follows: . . . since reading and

Delphi Graphics32 transparent layer draw line

∥☆過路亽.° 提交于 2019-11-28 02:16:05
I am trying to add a layer to an ImgView32, and on that layer I want to draw a line. But, I want that layer to be transparent, so it wont cover all the layers added previously. So I want to obtain: layer 1 -> image layer 2 -> another image layer 3 -> draw a line layer 4 -> another image This is a following to question: Delphi Graphics32 how to draw a line with the mouse on a layer You will find the code that I use for drawing the line and declaring the BitmapLayer following the link. I do not want to add it here so the question will remain small. Btw, I already tried to declare this for the

Delphi Graphics32 transparent layer draw line

空扰寡人 提交于 2019-11-26 22:09:52
问题 I am trying to add a layer to an ImgView32, and on that layer I want to draw a line. But, I want that layer to be transparent, so it wont cover all the layers added previously. So I want to obtain: layer 1 -> image layer 2 -> another image layer 3 -> draw a line layer 4 -> another image This is a following to question: Delphi Graphics32 how to draw a line with the mouse on a layer You will find the code that I use for drawing the line and declaring the BitmapLayer following the link. I do not