Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / ImageKit, how to edit the pixel data?

Author
Message
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 21st Dec 2012 05:10
I can't draw to an image unless it's made a render target. But I can't create a memblock from a render target because it's locked. So what can I do?

"You're not going crazy. You're going sane in a crazy world!" ~Tick
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 23rd Dec 2012 00:01
I tend to just use IK Dot, for transparency I dot with a specific colour, like rgb(255,0,255), then set that colour to transparent.

I got a fever, and the only prescription, is more memes.
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 24th Dec 2012 18:32
I need to read the current image data as well, and IK POINT doesn't work on render targets.

"You're not going crazy. You're going sane in a crazy world!" ~Tick
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 25th Dec 2012 14:27
IK dot is sloooowww.

Does it have to be a render target? Why not use a normal image, you can write and read from it easily by using a memblock.

TheComet

Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 25th Dec 2012 17:58
Because it won't let me "draw to image" on a non-render target.

"You're not going crazy. You're going sane in a crazy world!" ~Tick
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 28th Dec 2012 16:12
Instead of diverting all drawing operation to a render target, what about pasting pixels on a standard image? (can't imagine this will be overly fast though)
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 29th Dec 2012 08:44
The initial speed of drawing to images isn't a bother, I only need to do that once to create the initial map. From then on I just edit the memblock. I was considering writing a function that would paste an image onto another image using memblocks which wouldn't be too hard to write, but figured there had to be an easier way.

Render targets can't be made into memblocks. But I can't paste images onto a "normal" image..... A normal image created in IK anyway. I don't know why Sasuke, but when you said that I had a "hey let me try this thing that is basically what I already did" and it worked! lol

Using make image from the Matrix Util dll, I'm able to draw to it and create a memblock from it. Perfect. And so a week passes, leaving me a oh DUH moment.

"You're not going crazy. You're going sane in a crazy world!" ~Tick
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 29th Dec 2012 12:29
Quote: "I was considering writing a function that would paste an image onto another image using memblocks which wouldn't be too hard to write, but figured there had to be an easier way."


There is, IK Paste Image On Image which does exactly that

Quote: "
From the help files:
IK Paste Image On Image Image Number, Destination Image, X, Y
IK Paste Image On Image Image Number, Destination Image, X, Y, Effect
IK Paste Image On Image Image Number, Destination Image, Left, Top, Right, Bottom
IK Paste Image On Image Image Number, Destination Image, Left, Top, Right, Bottom, Effect

For normal images:
Only the first version where only X and Y are specified is available for normal images. Normal images support the most blend modes (see IK Set Blend Mode).

For render targets:
Pastes an image on a render target. You can also stretch the image, and apply an effect to it. If the effect doesn't specify the blend operations, the filtering mode or UV address mode, then the current modes will be used. (see IK Set Blend Mode, IK Set Filters, IK Set Address UV).

In case of the first version, the current blend mode will always be used."


Quote: "I don't know why Sasuke, but when you said that I had a "hey let me try this thing that is basically what I already did" and it worked! lol"


Haha

Quote: "Using make image from the Matrix Util dll"


Yeah, totally forgot about Matrix plug, you can create an image and set the D3D format which I see is what you have done.

Login to post a reply

Server time is: 2026-07-07 09:04:56
Your offset time is: 2026-07-07 09:04:56