Results 1 to 9 of 9

Thread: ImagesDLL alternative project

  1. #1
    Senior Member Lionheart008's Avatar
    Join Date
    Sep 2008
    Location
    Germany, Bad Sooden-Allendorf
    Age
    52
    Posts
    944
    Rep Power
    111

    ImagesDLL alternative project

    http://community.thinbasic.com/index...;topicseen#new

    more to come next days. I will build another image dll for thinbasic
    I still have to adept all to thinbasic yet.

    best regards, good night, Frank
    ps: "Images.dll" and "ImagesDll_test.exe" example I saved as attachement
    Attached Images Attached Images
    Attached Files Attached Files
    you can't always get what you want, but if you try sometimes you might find, you get what you need

  2. #2
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,153
    Rep Power
    736

    Re: ImagesDLL alternative project

    Hi Frank,

    how do you load the images, do you use gdiPlus or COM?
    Is it targeted only at control (like hijacking explorer control to display JPG/PNG) or does your function allow retrieving width, height, number of channels and RGB(A) or BGR(A) raw sequence?


    Thanks,
    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  3. #3
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,817
    Rep Power
    10

    Re: ImagesDLL alternative project

    Frank,

    yes it would be very useful to know the approach you have followed because if you have just used GDI32 API (and not GDI+ or some control tricks) it would open a lot of new possibilities.

    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  4. #4
    Senior Member Lionheart008's Avatar
    Join Date
    Sep 2008
    Location
    Germany, Bad Sooden-Allendorf
    Age
    52
    Posts
    944
    Rep Power
    111

    Re: ImagesDLL alternative project

    hi, short, come back from work some minutes before...

    send you both per e-mail my stuff.

    I have not used GDI32 API, but "win32api.inc" and "commctrl.inc" for pb dll example.
    my problem is to parse my images.dll code for thinbasic correctly.

    I was yesterday evening first of all looking for an easy image loading example with powerbasic. so I take this one.

    the thinbasic script example works in a certain way, but I cannot load the important dialog for image using ;(

    if I know where to find more infos about gdi32 api, I will check this one

    best regards, frank
    ps: I will delete this code examples in some hours because thinbasic script isn't ready and complete yet
    you can't always get what you want, but if you try sometimes you might find, you get what you need

  5. #5
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,817
    Rep Power
    10

    Re: ImagesDLL alternative project



    ok I got it. You are using the ListView trick so in reality you are not managing JPG directly using GDI but you are demanding the hard work to SysListview32
    Unfortunately this is something that will not help TBGL to manage image so it is an unpractical way at the moment.

    Thanks anyway.
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  6. #6
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,153
    Rep Power
    736

    Re: ImagesDLL alternative project

    Hi Frank,

    thanks for the code!

    The problem could be in fact your TB module function has parameters - I don't think it is allowed, you should get the data in using the thinBasic_ commands exclusively.

    Because you first create and SHOW MODAL the dialog, those thinbasic_ commands will never get parsed (actually yes, after destruction of the dialog).

    Also you first pass pointer to xWin variable, and then some equate. What is the purpose of xWin?

    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  7. #7
    Senior Member Lionheart008's Avatar
    Join Date
    Sep 2008
    Location
    Germany, Bad Sooden-Allendorf
    Age
    52
    Posts
    944
    Rep Power
    111

    Re: ImagesDLL alternative project

    hi petr, eros, all.

    hmh, it's a pity, I thought my example could help. I am not a powerbasic profi. this try was done by heart. I needed nearly one hour to check all and write down the scripts.

    1) you are looking for this kind of "gdi32.dll" code ?

    1a) qt: why it's not possible to write an own gdi32 application by c++ ? Or perhaps anywhere some code parts still exists so we can adept it to powerbasic / thinbasic ?

    Dim objGraphicsSource As Graphics = PictureBox1.CreateGraphics
    Dim bmpSource As New Bitmap(PictureBox1.Width, PictureBox1.Height,
    objGraphicsSource)
    Dim objGraphicsBmp As Graphics = Graphics.FromImage(bmpSource)
    Dim hdcSource As IntPtr = objGraphicsSource.GetHdc
    Dim hdcDest As IntPtr = objGraphicsBmp.GetHdc
    BitBlt(hdcDest, 0, 0, 50, pbxSource.Height, hdcSource, 0, 0, 13369376)
    PictureBox2.Image = bmpSource.Clone()

    Declare Auto Function BitBlt Lib "GDI32.DLL" ( _
    ByVal hdcDest As IntPtr, _
    ByVal nXDest As Integer, _
    ByVal nYDest As Integer, _
    ByVal nWidth As Integer, _
    ByVal nHeight As Integer, _
    ByVal hdcSrc As IntPtr, _
    ByVal nXSrc As Integer, _
    ByVal nYSrc As Integer, _
    ByVal dwRop As Int32) As Boolean
    it's possible to write an own GDI32.DLL with powerbasic? I am new with these things.

    Also you first pass pointer to xWin variable, and then some equate. What is the purpose of xWin?
    it was only an experimental helper to start the dialog and has no closer sense for tb code.

    => I am often thinking computer make life more comfortable and easier to handle an daily life. but the other side looks like a box with one thousand doors and little red devils in it they coming out one by one if you are looking for a problem and one more door is open with one hundred more problems and the solution lives in door 999

    best regards, frank (a little bit frustrated that this was not the wished solution ) ;(
    you can't always get what you want, but if you try sometimes you might find, you get what you need

  8. #8
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,817
    Rep Power
    10

    Re: ImagesDLL alternative project

    Hi Frank,

    thanks for your help but the point is another.
    What we are trying to get is the possibility to have a small module with the capability to load JPG, PNG files in memory and read the bitmap data directly.
    This can be done quite easily using GDIPlus but this will come in thinBasic 2.x version (around next year). We want to stay with GDI32 only.

    It seems the library I've found can do the job using Microsoft C runtime and this can be accepted because it is installed almost in every Microsoft OS (or so).

    Thanks anyway.

    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  9. #9
    Senior Member Lionheart008's Avatar
    Join Date
    Sep 2008
    Location
    Germany, Bad Sooden-Allendorf
    Age
    52
    Posts
    944
    Rep Power
    111

    Re: ImagesDLL alternative project

    although there is perhaps no more need for it, I have managed to include gdi+ (gdiplus!)features in my "batmanDLL" and so you can load in two different ways images. the pity is I have done only for powerbasic I am sad about this one. but I don't know if this is also possible with current "GDIp" feature. for me it was a very good exercise to include all important graphic features inkl. transparence and make argb color !

    ' // Create a Bitmap object from a JPEG file.
    ...
    ' // Draw the bitmap
    hStatus = GdipDrawImageI(pGraphics, pBitmap, 0, 0)

    ' // Get the width and height of the bitmap
    hStatus = GdipGetImageWidth(pBitmap, nWidth)
    hStatus = GdipGetImageHeight(pBitmap, nHeight)

    ' // Make an ARGB color
    pixelColor = GdiPlusMakeARGBColor(255, 0, 0, 0)
    you can test the powerbasic example, I have added the dll, exe file and photos here.

    1) after open the first dialog with gradient colors, open with "xmen" button new "batman" dialog. at the top you will find two new buttons ("photoPix!") and ("myHobby!"). each button open same picture (boat) as *.png and *jpg format.
    - with "photoPix!" button you load a jpg picture created a checkered pattern of black pixels in the bitmap. not so bad, isn't it ?

    2) you can also draw rectangle in this dialog and make black holes!

    test this example, if you like it. I will see if there is any possibility to adept it for thinbasic too. I think so.

    good night, frank experimento
    Attached Images Attached Images
    Attached Files Attached Files
    you can't always get what you want, but if you try sometimes you might find, you get what you need

Similar Threads

  1. ThinBasic... an alternative?
    By Polarwolf in forum Shout Box Area
    Replies: 12
    Last Post: 14-08-2008, 20:03

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •